Search code examples
c++windowswxwidgets

wxWidgets 3.1.0 project error on windows 10


i am a newbie here and i need help in compiling my wxwidgets project to work with codeblocks.

i downloaded wxwidgets windows intaller 'wxMSW-3.1.0-Setup.exe' from http://www.wxwidgets.org/downloads/

i run the program to install, then i read about making environmental variable at system properties>>advanced system settings>>environment variables. thus i made it by setting variable name as "path" and variable value as "C:\Program Files (x86)\CodeBlocks\MinGW\bin".

also read about making builds for wxwidget in cmd prompt, so launch cmd and input such procedures below (some which took a long time).

  1. mingw32-make -v
  2. cd C:\wxWidgets-3.1.0\build\msw
  3. mingw32-make -f makefile.gcc clean
  4. mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=1 UNICODE=1
  5. mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1

after all that i went on to make a wxwidgets project. i got two errors when making wxwidgets project "a matching debug configuration cannot be found in the wxwidgets directory you specified" and "a matching release configuration cannot be found in the wxwidgets directory you specified"

but then i skip and went on to project, after build and run i got these errors below.

Build log for debug:

-------------- Build: Debug in testwx (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -LC:\wxWidgets-3.1.0\lib\gcc_lib -o bin\Debug\testwx.exe obj\Debug\testwxApp.o obj\Debug\testwxMain.o obj\Debug\resource.res -mthreads -lwxmsw30u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw30u collect2.exe: error: ld returned 1 exit status Process terminated with status 1 (0 minute(s), 5 second(s)) 2 error(s), 0 warning(s) (0 minute(s), 5 second(s))

Build log for release:

-------------- Build: Release in testwx (compiler: GNU GCC Compiler)---------------

windres.exe -IC:\wxWidgets-3.1.0\include -IC:\wxWidgets-3.1.0\lib\gcc_lib\mswu -J rc -O coff -i C:\Users\AJIKAH~1\DOCUME~1\Programs\WXWIDG~1\testwx\resource.rc -o obj\Release\resource.res mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -std=c++11 -IC:\wxWidgets-3.1.0\include -IC:\wxWidgets-3.1.0\lib\gcc_lib\mswu -c "C:\Users\A JIKAH\Documents\Programs\wxWidgets\testwx\testwxApp.cpp" -o obj\Release\testwxApp.o mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -O2 -std=c++11 -IC:\wxWidgets-3.1.0\include -IC:\wxWidgets-3.1.0\lib\gcc_lib\mswu -c "C:\Users\A JIKAH\Documents\Programs\wxWidgets\testwx\testwxMain.cpp" -o obj\Release\testwxMain.o mingw32-g++.exe -LC:\wxWidgets-3.1.0\lib\gcc_lib -o bin\Release\testwx.exe obj\Release\testwxApp.o obj\Release\testwxMain.o obj\Release\resource.res -s -mthreads -lwxmsw30u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows C:/Program Files (x86)/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw30u collect2.exe: error: ld returned 1 exit status Process terminated with status 1 (0 minute(s), 33 second(s)) 2 error(s), 0 warning(s) (0 minute(s), 33 second(s))

now i update code::blocks 16.01 to code::blocks 17.01.

can someone pls help me solve this problem?


Solution

  • You said you downloaded "wxMSW-3.1.0-Setup.exe". But this part "...cannot find -lwxmsw30u..." means you're trying to link with libraries from wxWidgets 3.0.

    To make sure your project is trying to link with the correct version of wxWidgets, on the second page of the codeblocks wizard (the one that says "Please select the wxWidgets version you want to use"), be sure to select the "wxWidgets 3.1.x" option.

    Another common cause of the "matching configuration cannot be found" problem is not selecting the right options on the 8th page of the wizard (the one that says "Please select various configuration options"). Since you said you build the library with the options " SHARED=0 MONOLITHIC=1 UNICODE=1", be sure to check "wxWidgets is built as a monolithic library" and "Enable unicode" and be sure "Use wxWidgets DLL" is unchecked.