codeblocks下wxWidgets编译与配置

如果编译失败,可以尝试把config.gcc(X:\wxWidgets\build\msw\config.gcc)中的CPPFLAGS?=后面加上-std=gnu++11 -fno-keep-inline-dllexport,即:
CPPFLAGS?= -std=gnu++11 -fno-keep-inline-dllexport

还有一个就是从网页上拷贝的编译命令有可能会出现不能识别的问题,不知道为什么,我手打mingw32-make再拷贝好眠的就能编译了,不然提示没有makefile.gcc

setup头文件找不到的问题:
wxwidgets目录下,找到include\wx\platform.h
打开,发现如下代码:
/*
   Include wx/setup.h for the Unix platform defines generated by configure and
   the library compilation options

   Note that it must be included before defining hardware symbols below as they
   could be already defined by configure but it must be included after defining
   the compiler macros above as msvc/wx/setup.h relies on them under Windows.
 */
#include "wx/setup.h"
所以我在搜索目录又添加了$(#wx.include)\msvc这一项
另外库做最好不要放在C盘,因为我放在C盘提示找不到文件,可能是因为系统对C盘保护。。。


路径设置参考:
我的路径设置如下:(resourse compiler跟compiler相同,cv,ctb是我另外两个库)


WXWIN就是wxwidgets库所在路径,添加到系统PATH中。


同时拥有两个库
如何同时使用wxwidgets的debug和release库
Q: How do I use both Debug and Release builds of wx libraries?

A: I would use the default method of doing it and the default folder naming.

Using these C::B custom varibles

WX_SUFFIX=""  // ANSI Release
WX_SUFFIX="d"  // ANSI Debug
WX_SUFFIX="u"  // Unicode Release
WX_SUFFIX="ud"  // Unicode debug

I use WX_CFG when I am using a special configuration WX_CFG="rc3"

Remember, the CodeBlocks globel variable WX needs to point to the wxWidgets folder.

Example minGW build command for "Unicode debug" 2.8.0 RC3

mingw32-make -f makefile.gcc VENDOR=rc3 CFG=rc3 USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1

"VENDOR=" just puts rc3 in the DLL name; "CFG=" sets which folder the DLL is placed in. In this case in lib\gcc_dllrc3

Before using CFG in the mingw32-make build you need to do one prior wxWidget build without using it; else the build errors out. (See note below.)

"__WXDEBUG__" must be defined (in the codeblocks project setting) if you wish to link against the debug version of wxWidgets DLL. Else you will get a runtime error, when you try to run your project output.

Contributed by Tim S

Note:

  • I have never gotten the following command to work
 mingw32-make -f makefile.gcc VENDOR=rc3 CFG=rc3 USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1
  • unless I have first run this command on the same wxWidgets folders
 mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug   UNICODE=1
  • I am guessing that the build without the CFG creates a file or directory needed by the build with the CFG.
我按这个方法试过了,不行。。。动态库可用(WX_CFG=share),静态库不行(WX_CFG=unshare),不知道是不是我什么地方有问题。。





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值