麻烦在Mingw 64下使用wxWidgets 3.0.2库

时间:2014-12-04 03:23:28

标签: c++ compilation wxwidgets mingw-w64

以下是我编写wxWidgets库的方法。

下载https://sourceforge.net/projects/wxwindows/files/3.0.2/wxMSW-Setup-3.0.2.exe

set path=%MINGW%\bin
cd D:\wxWidgets-3.0.2\build\msw

mingw32-make -f makefile.gcc CFG=64 CXXFLAGS=-std=c++11 BUILD=debug UNICODE=1 MONOLITHIC=1
mingw32-make -f makefile.gcc CFG=64 CXXFLAGS=-std=c++11 BUILD=release UNICODE=1 MONOLITHIC=1

无法将我的测试程序与已构建的新库链接起来。

D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_filename.o): In function `wxChmod(wxString const&, unsigned short)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:513: undefined reference to `wxMSLU__wchmod(wchar_t const*, int)'
D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_filename.o): In function `wxOpen(wxString const&, int, unsigned short)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:515: undefined reference to `wxMSLU__wopen(wchar_t const*, int, int)'
D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_file.o): In function `wxRemove(wxString const&)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/wxcrt.h:758: undefined reference to `wxMSLU__wremove(wchar_t const*)'
D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_file.o): In function `wxAccess(wxString const&, unsigned short)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:511: undefined reference to `wxMSLU__waccess(wchar_t const*, int)'
D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_filefn.o): In function `wxRename(wxString const&, wxString const&)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/wxcrt.h:760: undefined reference to `wxMSLU__wrename(wchar_t const*, wchar_t const*)'
D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_filefn.o): In function `wxRmDir(wxString const&)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:524: undefined reference to `wxMSLU__wrmdir(wchar_t const*)'
D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_filefn.o): In function `wxMkDir(wxString const&, unsigned short)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:528: undefined reference to `wxMSLU__wmkdir(wchar_t const*)'
D:\wxWidgets-3.0.2\lib\gcc_lib64/libwxmsw30ud.a(monolib_ffile.o): In function `wxFopen(wxString const&, wxString const&)':
D:\wxWidgets-3.0.2\build\msw/../../include/wx/wxcrt.h:754: undefined reference to `wxMSLU__wfopen(wchar_t const*, wchar_t const*)'

我在这里做错了什么。您是否看到库的构建方式存在任何问题。

1 个答案:

答案 0 :(得分:9)

最后,我想出了如何使用MingW Drangon 64位构建WxWidgets。

您不应将CXX标记设置为-std=c++11

这里注意到我在WxWidgets文件夹中找到了。我的问题就在于此!

  

C ++ 11注意:如果你想在C ++ 11模式下编译wxWidgets,那么你   目前有               使用-std = gnu ++ 11开关为-std = c ++ 11禁用某些扩展               那些wxWidgets依赖。即请使用CXXFLAGS =" -std = gnu ++ 11"。

下载https://sourceforge.net/projects/wxwindows/files/3.0.2/wxMSW-Setup-3.0.2.exe

set path=C:\mingw64\bin
cd C:\wxWidgets-3.0.2\build\msw

mingw32-make -f makefile.gcc CXXFLAGS="-std=gnu++11" BUILD=debug UNICODE=1 SHARED=1
mingw32-make -f makefile.gcc CXXFLAGS="-std=gnu++11" BUILD=release UNICODE=1 SHARED=1
mingw32-make -f makefile.gcc CXXFLAGS="-std=gnu++11" BUILD=debug UNICODE=1 SHARED=0
mingw32-make -f makefile.gcc CXXFLAGS="-std=gnu++11" BUILD=release UNICODE=1 SHARED=0