User forums > Help
Problem Linking Gcc : A new wxwidget project
Anonymous:
Hi all, I face the similar problem after uninstalling older version and install the beta 6.0 . But this time,the linker error message seems like related to wxwidgets
--- Quote ---
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x1b):main.cpp: undefined reference to `wxFrameNameStr'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x41):main.cpp: undefined reference to `wxDefaultSize'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x49):main.cpp: undefined reference to `wxDefaultPosition'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x94):main.cpp: undefined reference to `wxMenuBar::wxMenuBar()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x2f3):main.cpp: undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x30f):main.cpp: undefined reference to `wxFrameNameStr'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x335):main.cpp: undefined reference to `wxDefaultSize'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x33d):main.cpp: undefined reference to `wxDefaultPosition'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x388):main.cpp: undefined reference to `wxMenuBar::wxMenuBar()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x5e7):main.cpp: undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x608):main.cpp: undefined reference to `wxFrame::~wxFrame()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x63c):main.cpp: undefined reference to `wxFrame::~wxFrame()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x670):main.cpp: undefined reference to `wxFrame::~wxFrame()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x6a3):main.cpp: undefined reference to `wxWindowBase::Close(bool)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x725):main.cpp: undefined reference to `wxMessageBox(wxString const&, wxString const&, long, wxWindow*, int, int)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x75d):main.cpp: undefined reference to `wxNewId()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x776):main.cpp: undefined reference to `wxNewId()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x7cc):main.cpp: undefined reference to `wxEVT_COMMAND_MENU_SELECTED'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x80a):main.cpp: undefined reference to `wxEVT_COMMAND_MENU_SELECTED'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x847):main.cpp: undefined reference to `wxEVT_NULL'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata+0x0):main.cpp: undefined reference to `wxFrame::sm_eventTable'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN10wxMenuBase6AppendEiRK8wxStringS2_10wxItemKind[wxMenuBase::Append(int, wxString const&, wxString const&, wxItemKind)]+0x31):main.cpp: undefined reference to `wxMenuItemBase::New(wxMenu*, int, wxString const&, wxString const&, wxItemKind, wxMenu*)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_Z16wxGetTranslationPKc[wxGetTranslation(char const*)]+0x7):main.cpp: undefined reference to `wxGetLocale()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_Z16wxGetTranslationPKc[wxGetTranslation(char const*)]+0x2a):main.cpp: undefined reference to `wxLocale::GetString(char const*, char const*) const'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN6wxMenuC1ERK8wxStringl[wxMenu::wxMenu(wxString const&, long)]+0x24):main.cpp: undefined reference to `vtable for wxMenu'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN6wxMenuC1ERK8wxStringl[wxMenu::wxMenu(wxString const&, long)]+0x3d):main.cpp: undefined reference to `wxMenu::Init()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN18wxAcceleratorArrayC1Ev[wxAcceleratorArray::wxAcceleratorArray()]+0xd):main.cpp: undefined reference to `wxBaseArrayPtrVoid::wxBaseArrayPtrVoid()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN10wxMenuBaseC2ERK8wxStringl[wxMenuBase::wxMenuBase(wxString const&, long)]+0xd):main.cpp: undefined reference to `wxEvtHandler::wxEvtHandler()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN10wxMenuBaseC2ERK8wxStringl[wxMenuBase::wxMenuBase(wxString const&, long)]+0x16):main.cpp: undefined reference to `vtable for wxMenuBase'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN10wxMenuBaseC2ERK8wxStringl[wxMenuBase::wxMenuBase(wxString const&, long)]+0x53):main.cpp: undefined reference to `wxMenuBase::Init(long)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN10wxListBaseC2E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x16):main.cpp: undefined reference to `vtable for wxListBase'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN10wxListBaseC2E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x28):main.cpp: undefined reference to `wxListBase::Init(wxKeyType)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN8wxObjectC2Ev[wxObject::wxObject()]+0x8):main.cpp: undefined reference to `vtable for wxObject'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN8wxString4InitEv[wxString::Init()]+0x7):main.cpp: undefined reference to `wxEmptyString'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN7wxFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)]+0xd):main.cpp: undefined reference to `wxFrameBase::wxFrameBase()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN7wxFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x16):main.cpp: undefined reference to `vtable for wxFrame'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN7wxFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x21):main.cpp: undefined reference to `wxFrame::Init()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN7wxFrameC2EP8wxWindowiRK8wxStringRK7wxPointRK6wxSizelS4_[wxFrame::wxFrame(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)]+0x5d):main.cpp: undefined reference to `wxFrame::Create(wxWindow*, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text$_ZN8wxStringC1EPKcj[wxString::wxString(char const*, unsigned int)]+0x2c):main.cpp: undefined reference to `wxString::InitWith(char const*, unsigned int, unsigned int)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x14):main.cpp: undefined reference to `wxObject::CreateRefData() const'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x18):main.cpp: undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x1c):main.cpp: undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x20):main.cpp: undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x28):main.cpp: undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x2c):main.cpp: undefined reference to `wxEvtHandler::DoGetClientObject() const'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x30):main.cpp: undefined reference to `wxEvtHandler::DoSetClientData(void*)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x34):main.cpp: undefined reference to `wxEvtHandler::DoGetClientData() const'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x38):main.cpp: undefined reference to `wxTopLevelWindowBase::Destroy()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x3c):main.cpp: undefined reference to `wxWindow::SetTitle(wxString const&)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x40):main.cpp: undefined reference to `wxWindow::GetTitle() const'
--- End quote ---
I have all the same settings as before, the only different is , I do not have C:\program files\CodeBlocks\lib as my Linker Dir because I could not find this directory in this new version.
I suppose it should be the linking problem with wxwidgets.
Anonymous:
Anybody have the idea ? I have tried a few way , even the I copy the configuration from an older version , the same problem occur .
I wonder is the bugs of beta6 or not , it seems like cannot link to the wxmsd library.
I just manage to solve the link problem but after upgrading code block, another link problem arise.
mandrav:
Have you tried re-building? Older object files may lurk there and fail linking.
Also, have you added the necessary link libraries in the project's build options? Note that the order the libraries appear, matters...
Post the *full* compile log if you want someone to help you. To enable full logging, go to "Settings/Configure plugins/Compiler", switch to the "Other" tab and select full logging.
Yiannis.
cyberkoa:
thank yiannis.
I hv tried re-build it give the same result
--- Quote ---
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x1b):main.cpp: undefined reference to `wxFrameNameStr'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x41):main.cpp: undefined reference to `wxDefaultSize'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x49):main.cpp: undefined reference to `wxDefaultPosition'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x94):main.cpp: undefined reference to `wxMenuBar::wxMenuBar()'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x2f3):main.cpp: undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x30f):main.cpp: undefined reference to `wxFrameNameStr'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x335):main.cpp: undefined reference to `wxDefaultSize'
C:\Documents and Settings\Administrator.XERUS-01.000\My Documents\My Projects\testwx\.objs\main.o(.text+0x33d):main.cpp: undefined reference to `wxDefaultPosition'
....
--- End quote ---
Anyway , I just manage to solve the problem by uninstalling (with remove old configuration) and reinstall code-block
FYI, I have tried to uninstall (without removing old configuration) and reinstall but cannot solve this problem.
I suspect any of the old settings / file in c:\program files\codeblock cause this problem.
Anyway , hurray again .. I am on the way again ... yeah ..
mandrav:
That's why I asked you for your full compile log. The compiler commands have changed in beta6 and you needed to remove the beta5 configuration first. I know I should make a note of it somewhere...
Just for anyone else reading this, there is no need to uninstall codeblocks just to clear its configuration. You can launch codeblocks once with the command line argument "--clear-configuration". It does exactly the same.
Anyway, I 'm glad you got it working.
Yiannis.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version