Page 1 of 1

codeblocks | wxwidgets compile undefined reference

Posted: Mon Apr 21, 2014 12:47 am
by guzzi_jones
I am fairly new to compiling code using library links and search paths.
I have ported most of my project from ubuntu to windows, but am not stuck with this error when compiling.

It seems to not see my wxwidgets libraries at all.
thanks for the help

Code: Select all

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

mingw32-g++.exe -LC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_dll -o bin\Debug\bdn.exe obj\Debug\bdnApp.o obj\Debug\bdnMain.o obj\Debug\dbcon.o obj\Debug\editchain.o obj\Debug\editcode_desc.o obj\Debug\editmasters_dialog.o obj\Debug\editstates.o obj\Debug\sql_error_dialog.o     -mwindows
obj\Debug\bdnApp.o: In function `Z11wxCreateAppv':
C:/c_tutorial/bdn/bdnApp.cpp:17: undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
obj\Debug\bdnApp.o: In function `[email protected]':
C:/c_tutorial/bdn/bdnApp.cpp:17: undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
obj\Debug\bdnApp.o: In function `ZN6bdnApp6OnInitEv':
C:/c_tutorial/bdn/bdnApp.cpp:23: undefined reference to `wxInitAllImageHandlers()'
obj\Debug\bdnApp.o: In function `ZN12wxAppConsole22SetInitializerFunctionEPFPS_vE':
C:/SourceCode/Libraries/wxWidgets2.8/include/wx/app.h:279: undefined reference to `wxAppConsole::ms_appInitFn'
obj\Debug\bdnApp.o: In function `ZN12wxAppConsole11GetInstanceEv':
C:/SourceCode/Libraries/wxWidgets2.8/include/wx/app.h:287: undefined reference to `wxAppConsole::ms_appInstance'
obj\Debug\bdnApp.o: In function `ZN6bdnAppC1Ev':
C:/c_tutorial/bdn/bdnApp.h:15: undefined reference to `wxApp::wxApp()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x8): undefined reference to `wxApp::GetClassInfo() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x14): undefined reference to `wxObject::CreateRefData() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x18): undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x1c): undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x20): undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x28): undefined reference to `wxEvtHandler::TryParent(wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x2c): undefined reference to `wxApp::GetEventTable() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x30): undefined reference to `wxApp::GetEventHashTable() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x34): undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x38): undefined reference to `wxEvtHandler::DoGetClientObject() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x3c): undefined reference to `wxEvtHandler::DoSetClientData(void*)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x40): undefined reference to `wxEvtHandler::DoGetClientData() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x44): undefined reference to `wxApp::Initialize(int&, char**)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x50): undefined reference to `wxAppBase::OnInitGui()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x54): undefined reference to `wxAppBase::OnRun()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x58): undefined reference to `wxAppBase::OnExit()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x5c): undefined reference to `wxApp::CleanUp()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x64): undefined reference to `wxAppBase::Exit()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x68): undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x6c): undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x70): undefined reference to `wxAppConsole::OnCmdLineHelp(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x74): undefined reference to `wxAppConsole::OnCmdLineError(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x78): undefined reference to `wxAppConsole::FilterEvent(wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x7c): undefined reference to `wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x84): undefined reference to `wxAppConsole::ProcessPendingEvents()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x88): undefined reference to `wxApp::Yield(bool)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x8c): undefined reference to `wxApp::WakeUpIdle()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x90): undefined reference to `wxAppBase::CreateTraits()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x94): undefined reference to `wxAppBase::MainLoop()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x98): undefined reference to `wxAppBase::ExitMainLoop()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x9c): undefined reference to `wxAppBase::Pending()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xa0): undefined reference to `wxAppBase::Dispatch()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xa4): undefined reference to `wxAppBase::ProcessIdle()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xa8): undefined reference to `wxAppBase::SendIdleEvents(wxWindow*, wxIdleEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xac): undefined reference to `wxApp::OnExceptionInMainLoop()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xb4): undefined reference to `wxAppBase::GetTopWindow() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xb8): undefined reference to `wxAppBase::GetDisplayMode() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xc4): undefined reference to `wxAppBase::GetLayoutDirection() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xc8): undefined reference to `wxAppBase::SetActive(bool, wxWindow*)'
obj\Debug\bdnApp.o: In function `ZN6bdnAppD1Ev':
C:/c_tutorial/bdn/bdnApp.h:15: undefined reference to `wxApp::~wxApp()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV20wxThreadHelperThread[__ZTV20wxThreadHelperThread]+0xc): undefined reference to `wxThread::TestDestroy()'
obj\Debug\bdnApp.o: In function `ZN20wxThreadHelperThreadD1Ev':
C:/SourceCode/Libraries/wxWidgets2.8/include/wx/thread.h:593: undefined reference to `wxThread::~wxThread()'
obj\Debug\bdnMain.o: In function `ZN8bdnFrameC2EP8wxWindowi':
C:/c_tutorial/bdn/bdnMain.cpp:75: undefined reference to `wxEmptyString'
C:/c_tutorial/bdn/bdnMain.cpp:75: undefined reference to `wxDefaultSize'
Process terminated with status 1 (0 minute(s), 8 second(s))
50 error(s), 0 warning(s) (0 minute(s), 8 second(s))
 

Re: codeblocks | wxwidgets compile undefined reference

Posted: Mon Apr 21, 2014 1:30 am
by guzzi_jones
Here is the full build log:

Code: Select all

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

mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\bdnApp.cpp -o obj\Debug\bdnApp.o
mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\bdnMain.cpp -o obj\Debug\bdnMain.o
mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\dbcon.cpp -o obj\Debug\dbcon.o
mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\editchain.cpp -o obj\Debug\editchain.o
C:\c_tutorial\bdn\editchain.cpp: In member function 'void editchain::load_choice(wxChoice*&, const char*)':
C:\c_tutorial\bdn\editchain.cpp:140:9: warning: variable 'r_lc_count' set but not used [-Wunused-but-set-variable]
mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\editcode_desc.cpp -o obj\Debug\editcode_desc.o
C:\c_tutorial\bdn\editcode_desc.cpp: In member function 'void editcode_desc::OnButton1Click(wxCommandEvent&)':
C:\c_tutorial\bdn\editcode_desc.cpp:156:18: warning: unused variable 'ch_sql' [-Wunused-variable]
C:\c_tutorial\bdn\editcode_desc.cpp: In member function 'void editcode_desc::OnButton3Click(wxCommandEvent&)':
C:\c_tutorial\bdn\editcode_desc.cpp:312:22: warning: unused variable 'ch_sql' [-Wunused-variable]
C:\c_tutorial\bdn\editcode_desc.cpp:287:9: warning: unused variable 'cell1' [-Wunused-variable]
C:\c_tutorial\bdn\editcode_desc.cpp: In member function 'void editcode_desc::OnGrid1LabelLeftClick(wxGridEvent&)':
C:\c_tutorial\bdn\editcode_desc.cpp:365:13: warning: unused variable 'row_value' [-Wunused-variable]
C:\c_tutorial\bdn\editcode_desc.cpp:353:9: warning: unused variable 'row' [-Wunused-variable]
C:\c_tutorial\bdn\editcode_desc.cpp:354:9: warning: unused variable 'col' [-Wunused-variable]
mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\editmasters_dialog.cpp -o obj\Debug\editmasters_dialog.o
C:\c_tutorial\bdn\editmasters_dialog.cpp: In member function 'void editmasters_dialog::OnButton2Click(wxCommandEvent&)':
C:\c_tutorial\bdn\editmasters_dialog.cpp:115:17: warning: unused variable 'parent' [-Wunused-variable]
C:\c_tutorial\bdn\editmasters_dialog.cpp: In member function 'void editmasters_dialog::OnButton3Click(wxCommandEvent&)':
C:\c_tutorial\bdn\editmasters_dialog.cpp:138:15: warning: unused variable 'parent' [-Wunused-variable]
C:\c_tutorial\bdn\editmasters_dialog.cpp: In member function 'void editmasters_dialog::Onfood_typeClick(wxCommandEvent&)':
C:\c_tutorial\bdn\editmasters_dialog.cpp:176:15: warning: unused variable 'parent' [-Wunused-variable]
mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\editstates.cpp -o obj\Debug\editstates.o
mingw32-g++.exe -Wall -g -IC:\SourceCode\Libraries\wxWidgets2.8\include -IC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\mswud -IC:\MinGW\msys\1.0\local\include -c C:\c_tutorial\bdn\sql_error_dialog.cpp -o obj\Debug\sql_error_dialog.o
mingw32-g++.exe -LC:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib -o bin\Debug\bdn.exe obj\Debug\bdnApp.o obj\Debug\bdnMain.o obj\Debug\dbcon.o obj\Debug\editchain.o obj\Debug\editcode_desc.o obj\Debug\editmasters_dialog.o obj\Debug\editstates.o obj\Debug\sql_error_dialog.o     -mwindows
obj\Debug\bdnApp.o: In function `Z11wxCreateAppv':
C:/c_tutorial/bdn/bdnApp.cpp:17: undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
obj\Debug\bdnApp.o: In function `[email protected]':
C:/c_tutorial/bdn/bdnApp.cpp:17: undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
obj\Debug\bdnApp.o: In function `ZN6bdnApp6OnInitEv':
C:/c_tutorial/bdn/bdnApp.cpp:23: undefined reference to `wxInitAllImageHandlers()'
obj\Debug\bdnApp.o: In function `ZN12wxAppConsole22SetInitializerFunctionEPFPS_vE':
C:/SourceCode/Libraries/wxWidgets2.8/include/wx/app.h:279: undefined reference to `wxAppConsole::ms_appInitFn'
obj\Debug\bdnApp.o: In function `ZN12wxAppConsole11GetInstanceEv':
C:/SourceCode/Libraries/wxWidgets2.8/include/wx/app.h:287: undefined reference to `wxAppConsole::ms_appInstance'
obj\Debug\bdnApp.o: In function `ZN6bdnAppC1Ev':
C:/c_tutorial/bdn/bdnApp.h:15: undefined reference to `wxApp::wxApp()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x8): undefined reference to `wxApp::GetClassInfo() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x14): undefined reference to `wxObject::CreateRefData() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x18): undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x1c): undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x20): undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x28): undefined reference to `wxEvtHandler::TryParent(wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x2c): undefined reference to `wxApp::GetEventTable() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x30): undefined reference to `wxApp::GetEventHashTable() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x34): undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x38): undefined reference to `wxEvtHandler::DoGetClientObject() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x3c): undefined reference to `wxEvtHandler::DoSetClientData(void*)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x40): undefined reference to `wxEvtHandler::DoGetClientData() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x44): undefined reference to `wxApp::Initialize(int&, char**)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x50): undefined reference to `wxAppBase::OnInitGui()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x54): undefined reference to `wxAppBase::OnRun()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x58): undefined reference to `wxAppBase::OnExit()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x5c): undefined reference to `wxApp::CleanUp()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x64): undefined reference to `wxAppBase::Exit()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x68): undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x6c): undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x70): undefined reference to `wxAppConsole::OnCmdLineHelp(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x74): undefined reference to `wxAppConsole::OnCmdLineError(wxCmdLineParser&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x78): undefined reference to `wxAppConsole::FilterEvent(wxEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x7c): undefined reference to `wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x84): undefined reference to `wxAppConsole::ProcessPendingEvents()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x88): undefined reference to `wxApp::Yield(bool)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x8c): undefined reference to `wxApp::WakeUpIdle()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x90): undefined reference to `wxAppBase::CreateTraits()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x94): undefined reference to `wxAppBase::MainLoop()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x98): undefined reference to `wxAppBase::ExitMainLoop()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0x9c): undefined reference to `wxAppBase::Pending()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xa0): undefined reference to `wxAppBase::Dispatch()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xa4): undefined reference to `wxAppBase::ProcessIdle()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xa8): undefined reference to `wxAppBase::SendIdleEvents(wxWindow*, wxIdleEvent&)'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xac): undefined reference to `wxApp::OnExceptionInMainLoop()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xb4): undefined reference to `wxAppBase::GetTopWindow() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xb8): undefined reference to `wxAppBase::GetDisplayMode() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xc4): undefined reference to `wxAppBase::GetLayoutDirection() const'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV6bdnApp[__ZTV6bdnApp]+0xc8): undefined reference to `wxAppBase::SetActive(bool, wxWindow*)'
obj\Debug\bdnApp.o: In function `ZN6bdnAppD1Ev':
C:/c_tutorial/bdn/bdnApp.h:15: undefined reference to `wxApp::~wxApp()'
obj\Debug\bdnApp.o:bdnApp.cpp:(.rdata$_ZTV20wxThreadHelperThread[__ZTV20wxThreadHelperThread]+0xc): undefined reference to `wxThread::TestDestroy()'
obj\Debug\bdnApp.o: In function `ZN20wxThreadHelperThreadD1Ev':
C:/SourceCode/Libraries/wxWidgets2.8/include/wx/thread.h:593: undefined reference to `wxThread::~wxThread()'
obj\Debug\bdnMain.o: In function `ZN8bdnFrameC2EP8wxWindowi':
C:/c_tutorial/bdn/bdnMain.cpp:75: undefined reference to `wxEmptyString'
C:/c_tutorial/bdn/bdnMain.cpp:75: undefined reference to `wxDefaultSize'
Process terminated with status 1 (0 minute(s), 14 second(s))
50 error(s), 10 warning(s) (0 minute(s), 14 second(s))
 

Re: codeblocks | wxwidgets compile undefined reference

Posted: Mon Apr 21, 2014 3:15 am
by guzzi_jones
ok so it looks like the compiler is writing the object files. Then the linker is totally failing.
It would appear my linker is not working correctly.

I am learning a lot.

Re: codeblocks | wxwidgets compile undefined reference

Posted: Tue Apr 22, 2014 1:02 pm
by guzzi_jones
does anyone have an idea of where i can look to debug this?

Re: codeblocks | wxwidgets compile undefined reference

Posted: Tue Apr 22, 2014 1:23 pm
by PB
It still looks to me as if you didn't properly compile wxWidgets (in requested configuration) or didn't tell the linker where to find it and what is its name. I don't remember details you may have posted in another threads, there were several people with similar problems recently and they all kind of blend together for me.

Can you at least create, compile, link and run a tiniest possible wxWidgets project, something like this?

Code: Select all

#include <wx/wx.h>

class MyFrame : public wxFrame
{
public:
    MyFrame()
        : wxFrame(NULL, wxID_ANY, _("Test"))
    {   }	
};

class MyApp : public wxApp
{
public:	
	virtual bool OnInit()
	{
        (new MyFrame())->Show();
        return true;
	}
};
IMPLEMENT_APP(MyApp)
If so, start with it and add additional things one by one, testing if it compiles after each such addition.

Re: codeblocks | wxwidgets compile undefined reference

Posted: Wed Apr 23, 2014 2:55 am
by guzzi_jones
Where doni put the linker name in build options?

Re: codeblocks | wxwidgets compile undefined reference

Posted: Wed Apr 23, 2014 5:25 am
by PB
I mean the name of the library íwxWidgets) not the linker name.

Re: codeblocks | wxwidgets compile undefined reference

Posted: Fri Apr 25, 2014 2:28 am
by guzzi_jones
In codeblocks i went to Project | build options | debug | linker settings.
I added C:\SourceCode\Libraries\wxWidgets2.8\lib\gcc_lib\libwxmsw28ud.a
Once i added the core and base it went through to libpqxx. This is another library i am using to connect to postgresql and is a HUGE pain to compile on windows with mingw.

i got it to compile using msys, but all the pathing is setup wrong in the library. /usr/bin/..... etc etc.
My hunch is it needs to be compiled in regular windows cmd.exe using mingw.

Re: codeblocks | wxwidgets compile undefined reference

Posted: Mon Apr 28, 2014 1:23 am
by guzzi_jones
In the end i was attempting to transfer my code from ubuntu to windows. After all this is supposed to be cross platform right? :)

It was a whole lot easier to create a wxwidgets dummy project with the wizard.
Any way this is what ended up working for me.
After first of course compiling wxwidgets with mingw with debug, static libraries, unicode.
Then compiling wxwidgets with mingw - release, static libraries, unicode.

Then run through the wizard making sure to choose the same settings you compiled wxwidgets with.
Then just go to project | add files and add all your .cpp files and .h files.

This process is a WHOLE lot easier on linux since it just uses the expression `wx-config`. No need to set every library.

Any way after learning more than i wanted to know about linkers and compilers i got it!