cannot find -lwxmsw31u_core and -lwxbase31u build errors code blocks with
Posted: Tue Jun 11, 2019 10:22 pm
Hi,
I am new to C++ but have other Windows programming experience. I was trying to install wxWidgets on Windows 7 32 bit (my computer permits 32 or 64 bit) but keep getting errors when I try to Build a skeleton project created by wxWidgets.
I have searched google extensively, read several articles that seem like they might help, but am simply stumped. I know it can be frustrating helping a newbe, however, I can assure you I have put in many hours of self-research before posting this question to the forum.
I am running Code Blocks 17.12; I just downloaded wxWidgets yesterday using the .7zip package. I eventually figured out I needed to do more than just extract the zip file. I used this link for wxWidgets install instructions: https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide.
Code Blocks seems to work well without wxWidgets; I can compile simple console programs and win32 ansi c programs that make use of createwindowex.
My best memory is that I used the GCC compiler that came with Code Blocks, however, I started down this path long ago with several gaps, so I can't be certain. The Directory for gcc is named TDM-GCC-32 (if that is any help) and the bin sub folder has a bunch of programs that start with mingw32-****.exe. A readme doc warns me that 'this edition of TDM-GCC is an unofficial replacement for the official GCC.'
I am not sure if this information about my compiler is important except that some search references mentioned a common source of some of the errors I have run across occur if you compile wxwidgets with a different compiler than the one used in Code Blocks. My Code Blocks is setup to use GNU GCC Compiler (first option in the combo box list of compiler choices).
BTW: I have also been playing with Visual Studio Express 2017, but have not attempted to use wxWidgets (yet) with Visual Studio. My goal is to become competent with both IDEs.
After installing wxWidgets with mingw32-make.exe as suggested in the wiki link I added some search items to the compiler and added to the linker (as per the same wiki link).
Then I try to create a new wxWidgets project using Code Blocks start page and I get an error: (from Start Here page) --> create new project --> wxWidgets project --> wxWidgets3.1.x --> Next --> Assign title (oktodel), accept default filename and default resulting filename --> next --> accept default author information --> Next --> wxFormBuilder + Frame Based (i have tried a few different combinations, but none have worked) --> next --> accept default wxWidget's location (which is hard coded as c:\...\wxwidget) --> next --> skipping debug config (per advice I saw on line which may have been bad advice, select release config and use default dirs for bin/obj output --> next --> use widgets dll (checked), enable unicode (tried both on and off); I also tried wxWidgets as a monolithic library (per initial instructions from a university website (instructions to students)), but have that feature off now ---> Next
Then I get an error that 'A matching Release configuration cannot be found in the wxWidgets directory you specified. This means the Release Target of your project will not build.'
I can't seem to get by this error. If I ignore the error (I click Yes to are you sure you want to continue) --> I get a list of additional libraries I might want to add to the project --> Finish.
Source code is generated and if I try to build the project (Release mode) lots of cool messages appear in the output box but 3 errors appear.
ld.exe --> cannot find -lwxmsw31_core
ld.exe --> cannot find =lwxbase31
ld returned 1 exit status
No other warnings.
My compiler search directories looks like this
c:\...\wxWidget\lib\gcc_lib\mswu
c:\...\wxWidget\include
My Linker settings screen is blank (nothing new added - I suspect this might be part of my problem but am not sure what to do)
Under Compiler Flags: I added two new items (per the wiki article referenced above). One is for linker stuff and the other for compiler stuff. I don't understand what I added, but diligently followed the instructions.
Never under estimate the power of ignorance: I may have created problems for myself by, at first, using mingw32-make.exe incorrectly. I did run the 'clean' option when following the wiki article, however, I am worried that something became corrupted while following the 'expert' advice of non experts.
I am hoping someone in the forum will know exactly what my problem is and be able to help.
Thanks in advance.
Ken
My build log is below:
-------------- Build: Release in oktodel (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -Wall -O2 -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_lib\mswu -IC:\PBWin10\AnsiCSamples\wxWidget\include -c C:\PBWin10\AnsiCSamples\LearnCPP\oktodel\oktodel\GUIFrame.cpp -o obj\Release\GUIFrame.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -Wall -O2 -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_lib\mswu -IC:\PBWin10\AnsiCSamples\wxWidget\include -c C:\PBWin10\AnsiCSamples\LearnCPP\oktodel\oktodel\oktodelApp.cpp -o obj\Release\oktodelApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -Wall -O2 -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_lib\mswu -IC:\PBWin10\AnsiCSamples\wxWidget\include -c C:\PBWin10\AnsiCSamples\LearnCPP\oktodel\oktodel\oktodelMain.cpp -o obj\Release\oktodelMain.o
windres.exe -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -J rc -O coff -i C:\PBWin10\ANSICS~1\LearnCPP\oktodel\oktodel\resource.rc -o obj\Release\resource.res
mingw32-g++.exe -LC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll -o bin\Release\oktodel.exe obj\Release\GUIFrame.o obj\Release\oktodelApp.o obj\Release\oktodelMain.o obj\Release\resource.res -s -mthreads -lwxmsw31_core -lwxbase31 -lwxpng -lwxzlib -mwindows
C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw31_core
C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: cannot find -lwxbase31
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 4 second(s))
3 error(s), 0 warning(s) (0 minute(s), 4 second(s))
I am new to C++ but have other Windows programming experience. I was trying to install wxWidgets on Windows 7 32 bit (my computer permits 32 or 64 bit) but keep getting errors when I try to Build a skeleton project created by wxWidgets.
I have searched google extensively, read several articles that seem like they might help, but am simply stumped. I know it can be frustrating helping a newbe, however, I can assure you I have put in many hours of self-research before posting this question to the forum.
I am running Code Blocks 17.12; I just downloaded wxWidgets yesterday using the .7zip package. I eventually figured out I needed to do more than just extract the zip file. I used this link for wxWidgets install instructions: https://wiki.wxwidgets.org/CodeBlocks_Setup_Guide.
Code Blocks seems to work well without wxWidgets; I can compile simple console programs and win32 ansi c programs that make use of createwindowex.
My best memory is that I used the GCC compiler that came with Code Blocks, however, I started down this path long ago with several gaps, so I can't be certain. The Directory for gcc is named TDM-GCC-32 (if that is any help) and the bin sub folder has a bunch of programs that start with mingw32-****.exe. A readme doc warns me that 'this edition of TDM-GCC is an unofficial replacement for the official GCC.'
I am not sure if this information about my compiler is important except that some search references mentioned a common source of some of the errors I have run across occur if you compile wxwidgets with a different compiler than the one used in Code Blocks. My Code Blocks is setup to use GNU GCC Compiler (first option in the combo box list of compiler choices).
BTW: I have also been playing with Visual Studio Express 2017, but have not attempted to use wxWidgets (yet) with Visual Studio. My goal is to become competent with both IDEs.
After installing wxWidgets with mingw32-make.exe as suggested in the wiki link I added some search items to the compiler and added to the linker (as per the same wiki link).
Then I try to create a new wxWidgets project using Code Blocks start page and I get an error: (from Start Here page) --> create new project --> wxWidgets project --> wxWidgets3.1.x --> Next --> Assign title (oktodel), accept default filename and default resulting filename --> next --> accept default author information --> Next --> wxFormBuilder + Frame Based (i have tried a few different combinations, but none have worked) --> next --> accept default wxWidget's location (which is hard coded as c:\...\wxwidget) --> next --> skipping debug config (per advice I saw on line which may have been bad advice, select release config and use default dirs for bin/obj output --> next --> use widgets dll (checked), enable unicode (tried both on and off); I also tried wxWidgets as a monolithic library (per initial instructions from a university website (instructions to students)), but have that feature off now ---> Next
Then I get an error that 'A matching Release configuration cannot be found in the wxWidgets directory you specified. This means the Release Target of your project will not build.'
I can't seem to get by this error. If I ignore the error (I click Yes to are you sure you want to continue) --> I get a list of additional libraries I might want to add to the project --> Finish.
Source code is generated and if I try to build the project (Release mode) lots of cool messages appear in the output box but 3 errors appear.
ld.exe --> cannot find -lwxmsw31_core
ld.exe --> cannot find =lwxbase31
ld returned 1 exit status
No other warnings.
My compiler search directories looks like this
c:\...\wxWidget\lib\gcc_lib\mswu
c:\...\wxWidget\include
My Linker settings screen is blank (nothing new added - I suspect this might be part of my problem but am not sure what to do)
Under Compiler Flags: I added two new items (per the wiki article referenced above). One is for linker stuff and the other for compiler stuff. I don't understand what I added, but diligently followed the instructions.
Never under estimate the power of ignorance: I may have created problems for myself by, at first, using mingw32-make.exe incorrectly. I did run the 'clean' option when following the wiki article, however, I am worried that something became corrupted while following the 'expert' advice of non experts.
I am hoping someone in the forum will know exactly what my problem is and be able to help.
Thanks in advance.
Ken
My build log is below:
-------------- Build: Release in oktodel (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -Wall -O2 -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_lib\mswu -IC:\PBWin10\AnsiCSamples\wxWidget\include -c C:\PBWin10\AnsiCSamples\LearnCPP\oktodel\oktodel\GUIFrame.cpp -o obj\Release\GUIFrame.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -Wall -O2 -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_lib\mswu -IC:\PBWin10\AnsiCSamples\wxWidget\include -c C:\PBWin10\AnsiCSamples\LearnCPP\oktodel\oktodel\oktodelApp.cpp -o obj\Release\oktodelApp.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -Wall -O2 -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_lib\mswu -IC:\PBWin10\AnsiCSamples\wxWidget\include -c C:\PBWin10\AnsiCSamples\LearnCPP\oktodel\oktodel\oktodelMain.cpp -o obj\Release\oktodelMain.o
windres.exe -IC:\PBWin10\AnsiCSamples\wxWidget\include -IC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll\msw -J rc -O coff -i C:\PBWin10\ANSICS~1\LearnCPP\oktodel\oktodel\resource.rc -o obj\Release\resource.res
mingw32-g++.exe -LC:\PBWin10\AnsiCSamples\wxWidget\lib\gcc_dll -o bin\Release\oktodel.exe obj\Release\GUIFrame.o obj\Release\oktodelApp.o obj\Release\oktodelMain.o obj\Release\resource.res -s -mthreads -lwxmsw31_core -lwxbase31 -lwxpng -lwxzlib -mwindows
C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: cannot find -lwxmsw31_core
C:/TDM-GCC-32/bin/../lib/gcc/mingw32/5.1.0/../../../../mingw32/bin/ld.exe: cannot find -lwxbase31
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 4 second(s))
3 error(s), 0 warning(s) (0 minute(s), 4 second(s))