adinxu
by adinxu
1 分钟 阅读用时

分类

标签

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

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"

另外库做最好不要放在C盘,因为我放在C盘提示找不到文件,可能是因为系统对C盘保护。。。

同时拥有两个库

如何同时使用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

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

“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:

我按这个方法试过了,不行。。。动态库可用(WX_CFG=share),静态库不行(WX_CFG=unshare),不知道是不是我什么地方有问题。。