惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
量子位
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
S
SegmentFault 最新的问题
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
Google DeepMind News
Google DeepMind News
小众软件
小众软件
WordPress大学
WordPress大学
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
B
Blog RSS Feed
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
Y
Y Combinator Blog
Microsoft Security Blog
Microsoft Security Blog
雷峰网
雷峰网
Jina AI
Jina AI
酷 壳 – CoolShell
酷 壳 – CoolShell

博客园 - 范圣帅

mono+jexus 之连接数据库 mono+jexus 验证码不显示:System.Drawing CentOS安装epel system 函数 tcp/ip协议listen函数中backlog参数的含义与php-fpm的502 Bad Gateway tengine-2.1.0 + lua + base64 tengine-2.1.0 + GraphicsMagick-1.3.20 nginx 反向代理 ArchLinux 下架设PPTPD VPN服务 - 范圣帅 archlinux 下 nignx + php 出现 no input file specified MAMP PRO 下安装 memcache MAC 版本 phpstorm 配置 theme Eclipse 破解ZendStudio 10.1 shell 快速移动,快捷操作 GDI 画出半透明 MFC 常用关闭窗口 MFC 中全局变量的使用 Unicode下RegQueryValueEx读取注册表值问题
[转]MinGW编译wxWidgets问题
范圣帅 · 2013-11-06 · via 博客园 - 范圣帅

其实利用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/