Compile problem

My Specs
* WinXP on x86
* CodeBlocks 10.05 - mingw32-g++.exe and related (default)
* wxPack for wxWidgets 2.8.12
* My Projects in 7Z: https://docs.google.com/open?id=0B7XEqelNSvg9dHUxeEpHT2lDbW8

Getting some weird compile errors:
1
2
3
4
5
6
7
||=== HackerEX_LIB, r_MSW ===|
..\HackerEX_GUI\obj\app\hexutils.o:hexutils.cpp|| undefined reference to `wxEmptyString'|
..\HackerEX_GUI\obj\app\hexutils.o:hexutils.cpp|| undefined reference to `wxEmptyString'|
..\HackerEX_GUI\obj\app\hexutils.o:hexutils.cpp:(.text$_ZN20wxThreadHelperThreadD1Ev[wxThreadHelperThread::~wxThreadHelperThread()]+0x11)||undefined reference to `wxThread::~wxThread()'|
..\HackerEX_GUI\obj\app\hexutils.o:hexutils.cpp:(.text$_ZN20wxThreadHelperThreadD0Ev[wxThreadHelperThread::~wxThreadHelperThread()]+0x14)||undefined reference to `wxThread::~wxThread()'|
..\HackerEX_GUI\obj\app\hexutils.o:hexutils.cpp:(.rdata$_ZTV20wxThreadHelperThread[vtable for wxThreadHelperThread]+0xc)||undefined reference to `wxThread::TestDestroy()'|
||=== Build finished: 5 errors, 0 warnings ===| 


Could someone give me an explanation so I can resolve these issues myself later.
Those are linker errors. You forgot to add the libraries to link against.
How when it is inluded via HackerEX_WXLIB which is linked by globals.hpp in HackerEX_LIB which is linked by hexutils.hpp which is linked by hexutils.cpp, by that path of logic the library should be included there, further I added the %WXWIN%\* to the global compiler search directories. Any clues?
Libraries are not "linked" by header files.

Generally the compiler supplies a directive to the linker concerning which libraries to link against. You need to explicitly supply the compiler with the names (and locations, if necessary) of libraries to link against via whatever build system you're using. If you're using an IDE (like CodeBlocks) there is generally a way to specify that within the IDE. See the documentation for the tool you're using.
Command line (bash):
$ g++ $(wx-config --cppflags) foo.cpp $(wx-config --libs)
that translates to
g++ -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 \
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ foo.cpp -pthread \
-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu \
-lwx_gtk2u_richtext-2.8 -lwx_gtk2u_aui-2.8 -lwx_gtk2u_xrc-2.8 \
-lwx_gtk2u_qa-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 \
-lwx_gtk2u_core-2.8 -lwx_baseu_xml-2.8 -lwx_baseu_net-2.8 -lwx_baseu-2.8
the -lwx_* are the libraries.
Last edited on
Thanks, I thought they were automatically linked via the project dependencies.
I cannot find any library that mentions thread in it's name, anyone able to tell me what I should be looking for?
Never mind, started including the cpp files too, still getting errors but only because I haven't finished getting the right files included.
Topic archived. No new replies allowed.