5

Here's how I compiled wxWidgets libraries.

Download 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

Not able to link my test program with new libraries built.

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*)'

What am I doing wrong here. Do you see any problem with the way libraries are built.

Marc.2377
  • 7,807
  • 7
  • 51
  • 95
user1
  • 4,031
  • 8
  • 37
  • 66
  • I am using Mingw 64 Drangon (http://www.drangon.org/mingw/) – user1 Dec 04 '14 at 03:26
  • See this post https://groups.google.com/forum/#!topic/wx-users/YQA0FKuyeU4 might be helpful – demented hedgehog Dec 04 '14 at 03:36
  • I recompiled wxWidgets library using -- mingw32-make -f makefile.gcc CFG=64 CXXFLAGS="-std=c++11 -DwxUSE_UNICODE_MSLU=0" BUILD=debug UNICODE=1 MONOLITHIC=1 But that didn't help. – user1 Dec 04 '14 at 04:03

1 Answers1

9

Finally, I figured out how to build WxWidgets with MingW Drangon 64 bit.

you should not set CXX flags to -std=c++11.

Here's note that I found in WxWidgets folder. There lies my problem!

C++11 note: If you want to compile wxWidgets in C++11 mode, you currently have to use -std=gnu++11 switch as -std=c++11 disables some extensions that wxWidgets relies on. I.e. please use CXXFLAGS="-std=gnu++11".

Download 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
Marc.2377
  • 7,807
  • 7
  • 51
  • 95
user1
  • 4,031
  • 8
  • 37
  • 66
  • 2
    Maybe someone should file a bug report; the default value for CXXFLAGS is empty which also causes build errors since c++11 features are relied on. I don't see any problem with having `config.gcc` include `CXXFLAGS ?= -std=gnu++11` – M.M Feb 04 '15 at 00:54
  • 3
    even better of course would be to fix the reliance on non-standard features :) – M.M Feb 04 '15 at 00:54
  • 1
    Thanks; this also solved [my mingw qmake (Qt) c++11 issue](http://stackoverflow.com/questions/30767553/undefined-reference-when-using-c11-qmake-flags). – edin-m Jul 04 '15 at 13:49
  • @M.M It seems this has been fixed. I was able to build wxWidgets version 3.1.0 successfully using `-std=c++11` and even `-std=c++14`. – Marc.2377 May 23 '16 at 19:06
  • 1
    @Marc.2377 awesome, I might have another look at it – M.M May 23 '16 at 22:27