【发布时间】:2014-01-17 07:15:20
【问题描述】:
在 Ubuntu 13.10、x86 上,使用 CodeBlocks 我已经成功地使用 minigw 从 unix 交叉编译到 Windows。在 windows 上测试并得到一个控制台。
它不适用于 wxwidgets。在 ubuntu 下工作正常,但它不会为 minigw 编译器编译 wxwidgets。
我已经这样做了:Code::Blocks and Cross Compilers 并使用控制台工作
但不适用于 wxwidgets。它引发了如下错误:
-------------- Build: Release in testwindows (compiler: MiniGW compiler for windows)---------------
i586-mingw32msvc-g++ -I/usr/lib/i386-linux-gnu/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -Wall -O2 -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -DSTRICT -DHAVE_W32API_H -D__WXMSW__ -D__WINDOWS__ -I/usr/i586-mingw32msvc/include -c /data1/backup_config/codeblocks/Learn/testwindows/testwindowsApp.cpp -o obj/Release/testwindowsApp.o
i586-mingw32msvc-g++: unrecognized option '-pthread'
In file included from /usr/include/wx-2.8/wx/platform.h:293,
from /usr/include/wx-2.8/wx/defs.h:21,
from /usr/include/wx-2.8/wx/event.h:15,
from /usr/include/wx-2.8/wx/app.h:20,
from /data1/backup_config/codeblocks/Learn/testwindows/testwindowsApp.h:13,
from /data1/backup_config/codeblocks/Learn/testwindows/testwindowsApp.cpp:10:
/usr/include/wx-2.8/wx/chkconf.h:23:30: error: wx/msw/chkconf.h: No such file or directory
报错时的源代码:
#elif defined(__WXMSW__)
# include "wx/msw/chkconf.h"
#elif defined(__WXMAC__)
所以,我检查了 /usr/include/wx/chkconfig.h 上的文件 chkconf.h 并且它存在。但是,# 中默认提供的代码块包括“wx/msw/chkconf.h”
如何解决此问题以使用 CodeBlocks 和 wxwidgets 2.8 正确交叉编译?
【问题讨论】:
-
交叉编译如果平台不能支持编译器。交叉编译到windows只是无缘无故地让自己头疼。所以不要这样做:在 windows 上为 windows 编译。
标签: c++ linux wxwidgets codeblocks