News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

MinGW32-GCC linker problem: lots of "undefined reference to" errors

Started by Comp_Lex, November 14, 2007, 09:44:36 PM

Previous topic - Next topic

Comp_Lex

Hello,

I have a problem with linking all the object files of my project in Codeblocks using wxWidgets 2.8.6 unicode static lib. Something has to do with the position of the links to static libs, dynamic libs an object files on the command line for mingw32-gcc, but I can't seem to fix it. I've looked at other topics on this forum and found some that look like my problem, but they're not really it. I hope you can fix it :)

My build log:

Quote-------------- Build: Release in sokath ---------------
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\Controller.cpp" -o obj\Release\Controller.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\HubbertCurve.cpp" -o obj\Release\HubbertCurve.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\HubbertCurvePanel.cpp" -o obj\Release\HubbertCurvePanel.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\HubbertLine.cpp" -o obj\Release\HubbertLine.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\HubbertLinearizationPanel.cpp" -o obj\Release\HubbertLinearizationPanel.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\LicenseDialog.cpp" -o obj\Release\LicenseDialog.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\OilProductionAnalyzer.cpp" -o obj\Release\OilProductionAnalyzer.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\SokathApp.cpp" -o obj\Release\SokathApp.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\SokathMain.cpp" -o obj\Release\SokathMain.o
mingw32-g++.exe -Wall  -DwxUSE_UNICODE  -O2 -Wall    -IC:\codeblocks -IC:\wxWidgets-2.8.6\include -IC:\wxWidgets-2.8.6\lib\vc_lib\mswu  -c "C:\Documents and Settings\Alexander_2\Mijn documenten\Sourceforge\Sokath\source\Sokath\WxNotebookPanel.cpp" -o obj\Release\WxNotebookPanel.o
mingw32-g++.exe -LC:\wxWidgets-2.8.6\include  -o bin\Release\sokath.exe obj\Release\Controller.o obj\Release\HubbertCurve.o obj\Release\HubbertCurvePanel.o obj\Release\HubbertLine.o obj\Release\HubbertLinearizationPanel.o obj\Release\LicenseDialog.o obj\Release\OilProductionAnalyzer.o obj\Release\SokathApp.o obj\Release\SokathMain.o obj\Release\WxNotebookPanel.o   -s    -mwindows
obj\Release\Controller.o:Controller.cpp:(.rdata$_ZTV20wxThreadHelperThread[vtable for wxThreadHelperThread]+0xc): undefined reference to `wxThread::TestDestroy()'
obj\Release\Controller.o:Controller.cpp:(.text$_ZN20wxThreadHelperThreadD1Ev[wxThreadHelperThread::~wxThreadHelperThread()]+0x13): undefined reference to `wxThread::~wxThread()'
obj\Release\Controller.o:Controller.cpp:(.text$_ZN20wxThreadHelperThreadD0Ev[wxThreadHelperThread::~wxThreadHelperThread()]+0x14): undefined reference to `wxThread::~wxThread()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x28b): undefined reference to `wxStringBase::npos'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x296): undefined reference to `wxDefaultSize'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x2c1): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x2fb): undefined reference to `vtable for wxFont'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x31e): undefined reference to `wxFont::DoCreate(int, wxSize const&, bool, int, int, int, bool, wxString const&, wxFontEncoding)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x371): undefined reference to `wxStockGDI::GetColour(wxStockGDI::Item)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x38c): undefined reference to `wxStockGDI::GetColour(wxStockGDI::Item)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x3a7): undefined reference to `wxStringBase::npos'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x3c5): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x415): undefined reference to `wxStringBase::npos'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x433): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x4a3): undefined reference to `wxEmptyString'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x4eb): undefined reference to `wxEmptyString'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x4fd): undefined reference to `wxStringBase::npos'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x519): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x532): undefined reference to `wxStringBase::swap(wxStringBase&)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x5b7): undefined reference to `wxString::Format(wchar_t const*, ...)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x5de): undefined reference to `wxStringBase::ConcatSelf(unsigned int, wchar_t const*, unsigned int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x76a): undefined reference to `wxFont::~wxFont()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x8b3): undefined reference to `wxFontBase::~wxFontBase()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x943): undefined reference to `wxEmptyString'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x954): undefined reference to `wxStringBase::npos'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x970): undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x989): undefined reference to `wxStringBase::swap(wxStringBase&)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x9f1): undefined reference to `wxString::Format(wchar_t const*, ...)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xa18): undefined reference to `wxStringBase::ConcatSelf(unsigned int, wchar_t const*, unsigned int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xae2): undefined reference to `wxFont::~wxFont()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xb88): undefined reference to `wxWindowBase::GetBackgroundColour() const'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xbc0): undefined reference to `wxSystemSettingsNative::GetColour(wxSystemColour)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xbe4): undefined reference to `wxObject::Ref(wxObject const&)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xc23): undefined reference to `wxColour::~wxColour()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xc52): undefined reference to `wxBrush::wxBrush(wxColour const&, int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xc8a): undefined reference to `wxBrush::~wxBrush()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xcae): undefined reference to `wxPen::wxPen(wxColour const&, int, int)'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xce6): undefined reference to `wxPen::~wxPen()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xdbb): undefined reference to `wxColour::~wxColour()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xe08): undefined reference to `wxPen::~wxPen()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xe1f): undefined reference to `wxColour::~wxColour()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xe4f): undefined reference to `wxBrush::~wxBrush()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xe64): undefined reference to `wxColour::~wxColour()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xf6f): undefined reference to `wxConvUTF8'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xf8e): undefined reference to `wxString::mb_str(wxMBConv const&) const'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0xfcc): undefined reference to `wxString::mb_str(wxMBConv const&) const'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x11be): undefined reference to `wxPanel::~wxPanel()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x123e): undefined reference to `wxPanel::~wxPanel()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x12be): undefined reference to `wxPanel::~wxPanel()'
obj\Release\HubbertCurvePanel.o:HubbertCurvePanel.cpp:(.text+0x1325): undefined reference to `wxStockGDI::GetColour(wxStockGDI::Item)'
Process terminated with status 1 (1 minutes, 19 seconds)
50 errors, 0 warnings

stahta01

Quote from: Comp_Lex on November 14, 2007, 09:44:36 PM
mingw32-g++.exe -LC:\wxWidgets-2.8.6\include

You need to fix this it should be a path to the Library.

I would guess it should be "mingw32-g++.exe -LC:\wxWidgets-2.8.6\lib\gcc_lib"

What compiler are you trying to use? MinGW GCC or Microsoft Visual C++?
( The log above showing includes of Microsoft Visual C++ folders which will cause issues.)

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]