Hi all,
I'm using wxWidgets with MinGW/TDM since wx version 2.8, almost without any problems.
Yesterday I downloaded the last version of TDM and wxWidgets to compile my project, and since then I'm having some problems. I always built the library with the commands:
mingw32-make -f makefile.gcc BUILD=debug SHARED=0 UNICODE=1
mingw32-make -f makefile.gcc BUILD=release SHARED=0 UNICODE=1
This time it doesn't work. It complained about the C++11. So I've changed to the following and it worked.
C:\wxWidgets-3.0.2\build\msw>mingw32-make -f makefile.gcc BUILD=debug SHARED=0 UNICODE=1 CXXFLAGS=-std=c++11 -Wall
C:\wxWidgets-3.0.2\build\msw>mingw32-make -f makefile.gcc BUILD=release SHARED=0 UNICODE=1 CXXFLAGS=-std=c++11 -Wall
After that, I tried to compile my project, but I'm facing some problems during the link stage. I've used the command below and the error message is:
g++ -static -static-libgcc -Wl,--subsystem,windows -mwindows "-LC:\\wxWidgets-3.0.2\\lib\\gcc_lib64" "-LC:\\wxWidgets-3.0.2\\lib\\gcc_lib" "-LC:\\wxWidgets-3.0.2\\lib" -o File.exe ALL_OBJECTS_FILES.O -lwxmsw30u_xrc -lwxmsw30u_gl -lopengl32 -lglu32 -lfreeglut -lwxmsw30u_richtext -lwxbase30u_net -lwxmsw30u_propgrid -lwxmsw30u_media -lwxmsw30u_aui -lwxmsw30u_html -lwxmsw30u_adv -lwxbase30u_xml -lwxmsw30u_core -lwxbase30u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lwxscintilla -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_filename.o):filename.cpp:(.text+0x273e): undefined reference to `wxMSLU__wchmod(wchar_t const*, int)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_filename.o):filename.cpp:(.text+0x13c): undefined reference to `wxMSLU__wopen(wchar_t const*, int, int)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_filefn.o):filefn.cpp:(.text+0x803a): undefined reference to `wxMSLU__wremove(wchar_t const*)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_filefn.o):filefn.cpp:(.text+0x9d4e): undefined reference to `wxMSLU__wrename(wchar_t const*, wchar_t const*)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_filefn.o):filefn.cpp:(.text+0xb257): undefined reference to `wxMSLU__wmkdir(wchar_t const*)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_filefn.o):filefn.cpp:(.text+0xc0d7): undefined reference to `wxMSLU__wrmdir(wchar_t const*)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_ffile.o):ffile.cpp:(.text+0x6d4e): undefined reference to `wxMSLU__wfopen(wchar_t const*, wchar_t const*)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_file.o):file.cpp:(.text+0x166): undefined reference to `wxMSLU__waccess(wchar_t const*, int)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_file.o):file.cpp:(.text+0x1fb3): undefined reference to `wxMSLU__wopen(wchar_t const*, int, int)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_file.o):file.cpp:(.text+0x2dd5): undefined reference to `wxMSLU__wopen(wchar_t const*, int, int)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_file.o):file.cpp:(.text+0x3ce4): undefined reference to `wxMSLU__wremove(wchar_t const*)'
C:\wxWidgets-3.0.2\lib\gcc_lib\libwxbase30u.a(baselib_file.o):file.cpp:(.text+0x5985): undefined reference to `wxMSLU__wremove(wchar_t const*)'
collect2.exe: error: ld returned 1 exit status
After that, I've tried compile the minimal example (command: mingw32-make -f makefile.gcc CXXFLAGS=-std=c+ +11) and I've got a similar message:
g++ -c -o gcc_mswud\minimal_minimal.o -g -O0 -mthreads -DHAVE_W32API_H -D__WXMS
W__ -D_UNICODE -I.\..\..\lib\gcc_lib\mswud -I.\..\..\include -W -Wall -I
. -I.\..\..\samples -DNOPCH -Wno-ctor-dtor-privacy -std=c++11 -MTgcc_mswud\m
inimal_minimal.o -MFgcc_mswud\minimal_minimal.o.d -MD -MP minimal.cpp
g++ -o gcc_mswud\minimal.exe gcc_mswud\minimal_sample_rc.o gcc_mswud\minimal_min
imal.o -g -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows
-lwxmsw30ud_core -lwxbase30ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxr
egexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -
lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lwi
ninet
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_filefn.o): In function `wxRemove(wxS
tring const&)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/wxcrt.h:758: undefined reference t
o `wxMSLU__wremove(wchar_t const*)'
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_filefn.o): In function `wxRename(wxS
tring const&, wxString const&)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/wxcrt.h:760: undefined reference t
o `wxMSLU__wrename(wchar_t const*, wchar_t const*)'
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_filefn.o): In function `wxRmDir(wxSt
ring const&)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:524: undefined reference
to `wxMSLU__wrmdir(wchar_t const*)'
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_filefn.o): In function `wxMkDir(wxSt
ring const&, unsigned short)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:528: undefined reference
to `wxMSLU__wmkdir(wchar_t const*)'
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_filename.o): In function `wxChmod(wx
String const&, unsigned short)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:513: undefined reference
to `wxMSLU__wchmod(wchar_t const*, int)'
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_filename.o): In function `wxOpen(wxS
tring const&, int, unsigned short)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:515: undefined reference
to `wxMSLU__wopen(wchar_t const*, int, int)'
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_file.o): In function `wxAccess(wxStr
ing const&, unsigned short)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/filefn.h:511: undefined reference
to `wxMSLU__waccess(wchar_t const*, int)'
.\..\..\lib\gcc_lib/libwxbase30ud.a(baselib_ffile.o): In function `wxFopen(wxStr
ing const&, wxString const&)':
C:\wxWidgets-3.0.2\build\msw/../../include/wx/wxcrt.h:754: undefined reference t
o `wxMSLU__wfopen(wchar_t const*, wchar_t const*)'
collect2.exe: error: ld returned 1 exit status
makefile.gcc:231: recipe for target 'gcc_mswud\minimal.exe' failed
mingw32-make: *** [gcc_mswud\minimal.exe] Error 1
Can anyone give me a hand with this?
Thank you