Hi,
I am a newbe using Windows 7 Pro, Code Blocks 17.12 and WxWidgets 3.1.2. I am using the GCC 32/64 bit compiler.
I have made great progress since I was recently able to get my first wxwidget projects to compile. I had good success writing some simple wxsmith projects and wanted to start playing with the wxwidgets sample projects. I am having difficulty compiling the Widgets sample project from Code Blocks in spite of the fact that (I believe, perhaps incorrectly) that my linker and search directories are setup correctly.
I installed WxWidgets such that I am Monolithic=no and Shared=0. I set Unicode = yes.
I realize the samples can be compiled from the cmd prompt, but prefer to compile from code blocks as that is the environment I expect to use when writing my own programs.
My build log is shown below my signature line. If I understand it correctly, the compiler is complaining it can't find some files that I believe are already linked in directories that are marked for searching.
Using Settings --> Compiler --> Linker Settings I see these files listed:
C:\TDM-GCC-64\x86_64-w64-mingw32\lib\libuxtheme.a
C:\TDM-GCC-64\x86_64-w64-mingw32\lib\liboleacc.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxjpegd.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxbase31u.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxjpegd.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxtiffd.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxmsw31ud_core.a
Using Settings --> Compiler --> Search Directories I see these directories:
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono
C:\wxWidgets-3.1.2\include
C:\wxWidgets-3.1.2\src\jpeg
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\mswud
I don't recall why I have the \..\src\jpeg directory in the search directories listing, but promise it made sense when I added it (probably following a help screen I found using google search). I don't know if the two references to gcc_lib_nodll_nomono are needed, but presume I added the 2nd search reference for some reason. Because I don't fully understand all of this I am doing a lot by trial and error; many errors.
It doesn't make sense to me that the build log (below) reports it can't find libwxmsw31ud_core.a when that file is specifically linked (as shown above).
Please let me know if you feel I have missed some key documentation (and I will read it).
I have experience documenting software for new users and am willing to write up my findings once I feel I have my sea legs. Please let me know if that is something that might help other new users; I don't need to reinvent the wheel, but would not mind contributing back to the community.
Thanks in advance.
Ken
Build started on: 17-06-2019 at 12:53.54
Build ended on: 17-06-2019 at 12:54.08
-------------- Build: Debug Win32 in widgets (compiler: GNU GCC Compiler)---------------
x86_64-w64-mingw32-g++.exe -L.\..\..\lib\vc_lib -o vc_mswud\widgets.exe vc_mswud\widgets\widgets\activityindicator.o vc_mswud\widgets\widgets\bmpcombobox.o vc_mswud\widgets\widgets\button.o vc_mswud\widgets\widgets\checkbox.o vc_mswud\widgets\widgets\choice.o vc_mswud\widgets\widgets\clrpicker.o vc_mswud\widgets\widgets\combobox.o vc_mswud\widgets\widgets\datepick.o vc_mswud\widgets\widgets\dirctrl.o vc_mswud\widgets\widgets\dirpicker.o vc_mswud\widgets\widgets\editlbox.o vc_mswud\widgets\widgets\filectrl.o vc_mswud\widgets\widgets\filepicker.o vc_mswud\widgets\widgets\fontpicker.o vc_mswud\widgets\widgets\gauge.o vc_mswud\widgets\widgets\headerctrl.o vc_mswud\widgets\widgets\hyperlnk.o vc_mswud\widgets\widgets\itemcontainer.o vc_mswud\widgets\widgets\listbox.o vc_mswud\widgets\widgets\native.o vc_mswud\widgets\widgets\notebook.o vc_mswud\widgets\widgets\odcombobox.o vc_mswud\widgets\widgets\radiobox.o vc_mswud\widgets\widgets\searchctrl.o vc_mswud\widgets\widgets\slider.o vc_mswud\widgets\widgets\spinbtn.o vc_mswud\widgets\widgets\statbmp.o vc_mswud\widgets\widgets\static.o vc_mswud\widgets\widgets\textctrl.o vc_mswud\widgets\widgets\timepick.o vc_mswud\widgets\widgets\toggle.o vc_mswud\widgets\widgets\widgets.o vc_mswud\widgets\sample.res -lwxmsw31ud_core -lwxbase31ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet C:\TDM-GCC-64\x86_64-w64-mingw32\lib\libuxtheme.a C:\TDM-GCC-64\x86_64-w64-mingw32\lib\liboleacc.a C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxjpegd.a C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxbase31u.a C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxjpegd.a C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxtiffd.a C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxmsw31ud_core.a -mwindows
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxmsw31ud_core
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxbase31ud
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxtiffd
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxjpegd
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxpngd
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxzlibd
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxregexud
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lwxexpatd
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 13 second(s))
9 error(s), 0 warning(s) (0 minute(s), 13 second(s))
cannot find ... libwxmsw31ud_core.a even though the file is linked
Re: cannot find ... libwxmsw31ud_core.a even though the file is linked
As i don't use CB, take everything i say with a grain of salt...
Did you list all files with absolute paths? You shoudln't do that. Use just the library names and set the library search paths separately.
Also, you're mixing files from different configurations here. Eg. the "d" in "libwxtiffd.a" stands for "debug" configuration. The "u" in libwxbase31u.a stands for "unicode". The "ud" in libwxmsw31ud_core.a stands for both "debug" and "unicode".
Libs like libwxjpeg and libwxtiff have no separate "unicode" version.
So, if you're building a debug version, the libwxbase31u.a is wrong here, it should be libwxbase31ud.a
There should be exactly two wxWidgets related entries here.
And in this order. The first one is where "setup.h" is included from. This can be different for each configuration, that's why it must be included first.
Also, check the library paths and make sure there are no old (wrong) files from previous experiments.
Code: Select all
C:\TDM-GCC-64\x86_64-w64-mingw32\lib\libuxtheme.a
C:\TDM-GCC-64\x86_64-w64-mingw32\lib\liboleacc.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxjpegd.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxbase31u.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxjpegd.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxtiffd.a
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\libwxmsw31ud_core.a
Also, you're mixing files from different configurations here. Eg. the "d" in "libwxtiffd.a" stands for "debug" configuration. The "u" in libwxbase31u.a stands for "unicode". The "ud" in libwxmsw31ud_core.a stands for both "debug" and "unicode".
Libs like libwxjpeg and libwxtiff have no separate "unicode" version.
So, if you're building a debug version, the libwxbase31u.a is wrong here, it should be libwxbase31ud.a
Code: Select all
Using Settings --> Compiler --> Search Directories I see these directories:
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono
C:\wxWidgets-3.1.2\include
C:\wxWidgets-3.1.2\src\jpeg
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\mswud
Code: Select all
C:\wxWidgets-3.1.2\lib\gcc_lib_nodll_nomono\mswud
C:\wxWidgets-3.1.2\include
Also, check the library paths and make sure there are no old (wrong) files from previous experiments.
Use the source, Luke!
Re: cannot find ... libwxmsw31ud_core.a even though the file is linked
This is a terrific reply.
Thank you so much for helping on this post.
I will study this information carefully and post my results so others might benefit if they happen to go down the same path.
Ken
Thank you so much for helping on this post.
I will study this information carefully and post my results so others might benefit if they happen to go down the same path.
Ken