其实利用MinGW编译wxWidgets是一件挺简单的事情,但是最近在编译的时候遇到一些问题,并找到解决方案,因此在此分享一下个人经验。编译出错的原因是由于安装了MSYS的缘故。

 
错误信息类似于如下的结果:

if not exist ../../lib/gcc_lib/mswud/wx mkdir ../../lib/gcc_lib/mswud/wx

process_begin: CreateProcess(NULL, -c "if not exist ../../lib/gcc_lib/mswud/wx mkdir ../../lib/gcc_lib/mswud/wx", ...) failed.

make (e=2)

产生错误的原因是因为安装了MSYS后,利用Make命令会首先执行MSYS中的SHELL命令,从而会导致编译错误,对于这种情况,可以修改 $(WX)/build/msw目录中的makefile.gcc文件,使其默认采用CMD命令行。

makefile.gcc修改前: SHELL := $(COMSPEC)
makefile.gcc修改后: SHELL := C:\WINDOWS\system32\CMD.exe    (该路径为实际的CMD.exe的路径)
 
 
 
==============================================================================
最后还是顺便说一下MinGW编译wxWidgets的流程:
1 下载源代码 http://www.wxwidgets.org/downloads/
2 修改 $(WX)/build/msw 目录中的makefile.gcc文件 (可选)
3 修改 $(WX)/build/msw 目录中的congfig.gcc文件 (下面贴出的congfig.gcc文件中的红色标记部分为需要修改的地方)
4 在控制台进入到 $(WX)/build/msw 目录中,执行 mingw32-make -f makefile.gcc
 
注: $(WX)表示你下载的源代码解压后的路径
 
 
对编译过程还不明白的可以查看官方说明:
 
 
 
==============================================================================
congfig.gcc文件
# =========================================================================
#     This configuration file was generated by
#     Bakefile 0.2.9 (http://www.bakefile.org)
#     Beware that all changes made to this file will be overwritten next
#     time you run Bakefile!
# =========================================================================
 
 
# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------
 
# Compiler flags to link shared library 
LINK_DLL_FLAGS ?= -shared
 
# Compiler flags to link loadable module 
LINK_MODULE_FLAGS ?= -shared
 
# C compiler 
CC = gcc
 
# C++ compiler 
CXX = g++
 
# Standard flags for CC 
CFLAGS ?= 
 
# Standard flags for C++ 
CXXFLAGS ?= 
 
# Standard preprocessor flags (common for CC and CXX) 
CPPFLAGS ?= 
 
# Standard linker flags 
LDFLAGS ?= 
 
# The C preprocessor 
CPP ?= $(CC) -E
 
# What type of library to build? [0,1]
SHARED ?= 1
 
# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0
 
# Compile Unicode build of wxWidgets? [0,1]
UNICODE ?= 1
 
# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0
 
# Type of compiled binaries [debug,release]
BUILD ?= release
 
# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default
 
# Should __WXDEBUG__ be defined? The default value "default" means that it will
# be defined if BUILD=debug and not defined if BUILD=release. [0,1,default]
DEBUG_FLAG ?= default
 
# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 1
 
# Build GUI libraries? [0,1]
USE_GUI ?= 1
 
# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1
 
# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1
 
# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC ?= 1
 
# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1
 
# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1
 
# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 0
 
# Build ODBC database classes (USE_GUI must be 1)? [0,1]
USE_ODBC ?= 0
 
# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0
 
# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1
 
# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1
 
# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1
 
# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0
 
# Link with gdiplus.lib? (Needed for wxGraphicsContext, will also set wxUSE_GRAPHICS_CONTEXT) [0,1]
USE_GDIPLUS ?= 0
 
# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0
 
# Use this to name your customized DLLs differently 
VENDOR ?= custom
 
#  
WX_FLAVOUR ?= 
 
#  
WX_LIB_FLAVOUR ?= 
 
# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory. 
CFG ?= 
 
# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers. 
CPPUNIT_CFLAGS ?= 
 
# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here. 
CPPUNIT_LIBS ?= 
 
# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic
 
# Set the version of your Mingw installation here.
#     "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
#     "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3
 
 
转自:http://blog.163.com/wangxuefan1220@126/blog/static/882114720124681233402/

[转]MinGW编译wxWidgets问题的更多相关文章

  1. MinGW编译wxWidgets中的问题及解决方法

    其实网上wxWidgets编译相关的博文,都没写到关键点上,泛泛而谈——就写了执行几个命令,就万事大吉了! 维基百科上的这个页面讲解了编译中可能遇到的各种问题及解决办法.比较懒,不想翻译.wxWidg ...

  2. 编译wxWidgets —— windows、vc71、bcc32、MinGW与命令行

    编译wxWidgets —— windows.vc71.bcc32.MinGW与命令行 http://www.diybl.com/course/3_program/vc/vc_js/20071226/ ...

  3. 使用Mingw编译wxSqlite3-3.0.5

    最近在学习wxWidgets,而且官方也出了3.0版本,貌似还不错的样子,准备做个小程序来练手.中间需要用到数据库看到很多人推荐wxSqlite3就去下来看看,以下是我使用TDM-GCC 4.8.1( ...

  4. 手把手教你在Windows下使用MinGW编译libav(参考libx264的编入)

    转自:http://www.th7.cn/Program/cp/201407/242762.shtml 手把手教你在Windows下使用MinGW编译libav libav是在Linux下使用纯c语言 ...

  5. Fedora 11中用MinGW编译Windows的Qt4程序(在Linux系统下编译Windows的程序)

    Ubuntu下可以直接安装: sudo apt-get install mingw32 mingw32-binutils mingw32-runtime 安装后编译程序可以: i586-mingw32 ...

  6. Windows下MinGW编译Qt4

    还真不是吹,这个问题折磨我一天……前些天转载了一篇关于<Eclipse+Qt开发环境设置>和<Eclipse+MinGW+Qt开发环境设置>两片文章,里面讲述了QT的开源版本q ...

  7. MingW编译virt-viewer

    在http://www.spice-space.org/download.html可以下载到windows版本的virt viewer virt-viewer-x86-0.5.7.msi和virt-v ...

  8. VS2008编译器编译出来的文件比mingw编译的要几乎小一半

    为什么要在VS2008中使用QT静态编译呢?很简单,因为VS2008编译器编译出来的文件比mingw编译的要几乎小一半. 好了现在我们来做些准备工作,VS2008自然要安装的,然后打上SP1的补丁.然 ...

  9. 在Windows环境下使用MinGW编译Qt 4.8.6

    1.修改环境变量工具推荐:Rapid Environment Editor.官网:http://www.rapidee.com/ 修改前请先备份当前的环境变量.然后: (1)检查系统变量path,删除 ...

随机推荐

  1. 64_p9

    python2-termcolor-1.1.0-11.fc26.noarch.rpm 12-Feb-2017 14:05 13610 python2-terminado-0.6-2.fc26.noar ...

  2. NEERC2014

    NEERC2014 A - Alter Board 题目描述:给出一个\(n \times m\)的国际象棋棋盘,每次选定一个矩形,使得矩形中的每个格子的颜色翻转,求出最少次数的方案使得最终棋盘只有一 ...

  3. 设计模式之笔记--享元模式(Flyweight)

    享元模式(Flyweight) 定义 享元模式(Flyweight),运用共享技术有效地支持大量细粒度的对象. 类图 描述 Flyweight:抽象享元类,是所有的具体享元类的基类,为子类规定出需要实 ...

  4. csu 1803(余数分类)

    1803: 2016 Time Limit: 5 Sec  Memory Limit: 128 MBSubmit: 565  Solved: 364[Submit][Status][Web Board ...

  5. Ubuntu16.4 zookeeper-3.4.10 单机多实例部署

    上传 zookeeper-3.4.10.tar.gz 到服务器 root@temple-:/usr/local/temple/jar# ll total drwxr-xr-x root root 8月 ...

  6. Hadoop(五)分布式集群中HDFS系统的各种角色

    NameNode 学习目标 理解 namenode 的工作机制尤其是元数据管理机制,以增强对 HDFS 工作原理的 理解,及培养 hadoop 集群运营中“性能调优”.“namenode”故障问题的分 ...

  7. Qt 下载列表地址

    每次下载Qt总是找好长时间,收藏一下地址 Qt 下载列表地址 https://www.qt.io/download-open-source/#section-9 教育网镜像下载 http://mirr ...

  8. LoadRunner监控Linux的三种方法

    方法一.LR + SiteScope/nmon 方法二.使用rstatd包 1.下载rpc.rstatd-4.0.1.tar.gz 2.解压缩 tar -zxvf rpc.rstatd-4.0.1.t ...

  9. yum使用

    一.使用yum安装和卸载软件,有个前提是yum安装的软件包都是rpm格式的.安装的命令是,yum install ~,yum会查询数据库,有无这一软件包,如果有,则检查其依赖冲突关系,如果没有依赖冲突 ...

  10. 【WPF】城市级联(XmlDataProvider)

    首先在绑定的时候进行转换: public class RegionConverter : IValueConverter { public object Convert(object value, T ...