Author Topic: Failing to build default wxWidgets project  (Read 6096 times)

Offline darus

  • Multiple posting newcomer
  • *
  • Posts: 14
Failing to build default wxWidgets project
« on: October 08, 2006, 04:15:58 pm »
I've downloaded nightly build and installed it, as written in Nightly Cookbook. I also downloaded MinGW and placed it in C:\Program Files\MinGW.

I've compiled wxWidgets with following commands:

Code
cd c:\Program Files\wxWidgets\build\msw
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=0 BUILD=debug UNICODE=1 clean
mingw32-make -f makefile.gcc SHARED=0 MONOLITHIC=0 BUILD=debug UNICODE=1

Building was successful and a bunch of libraries was created in C:\Program Files\wxWidgets\lib\gcc_lib.

Then I created new CodeBlocks "wxWidgets application" project, checked "Use debugging libraries", unchecked "Use wxWidgets DLL", "wxWidgets is built as monolithic library". "Enable unicode" flag was set by default and I left it that way.

CodeBlocks said something about "Matching configuration cannot be found...", I pressed "Yes".

When trying to complie this project, linker complained about "cannot find -lwxcore26u". I've replaced wxcore26u library by the wxmsw26ud_core library, that I found in C:\Program Files\wxWidgets\lib\gcc_lib. However this time linker ended up with whole bunch of errors:
Code
Linking console executable: bin\Debug\Test.exe
obj\Debug\main.o(.text+0x13d6): In function `Z41__static_initialization_and_destruction_0ii':
C:/Documents and Settings/Darus/My Documents/Work/Active_Projects/Chimecho/Test/main.cpp:32: undefined reference to `wxEventHashTable::wxEventHashTable(wxEventTable const&)'
obj\Debug\main.o(.text+0x14a2):C:/Documents and Settings/Darus/My Documents/Work/Active_Projects/Chimecho/Test/main.cpp:35: undefined reference to `wxEVT_NULL'
obj\Debug\main.o(.text+0x14c5):C:/Documents and Settings/Darus/My Documents/Work/Active_Projects/Chimecho/Test/main.cpp:32: undefined reference to `wxEventHashTable::~wxEventHashTable()'
obj\Debug\main.o(.text$_ZN12wxStringBase10ConcatSelfEjPKw[wxStringBase::ConcatSelf(unsigned int, wchar_t const*)]+0x22): In function `ZNK12wxWindowBase8GetLabelEv':
C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxStringBase::ConcatSelf(unsigned int, wchar_t const*, unsigned int)'
obj\Debug\main.o(.text$_ZN12wxStringBaseC2EPKw[wxStringBase::wxStringBase(wchar_t const*)]+0x7):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxStringBase::npos'
obj\Debug\main.o(.text$_ZN12wxStringBaseC2EPKw[wxStringBase::wxStringBase(wchar_t const*)]+0x25):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'
obj\Debug\main.o(.text$_Z16wxGetTranslationPKw[wxGetTranslation(wchar_t const*)]+0x7):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxGetLocale()'
obj\Debug\main.o(.text$_Z16wxGetTranslationPKw[wxGetTranslation(wchar_t const*)]+0x2a):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxLocale::GetString(wchar_t const*, wchar_t const*) const'
obj\Debug\main.o(.text$_ZN18wxAcceleratorArrayD1Ev[wxAcceleratorArray::~wxAcceleratorArray()]+0xd):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxBaseArrayPtrVoid::~wxBaseArrayPtrVoid()'
obj\Debug\main.o(.text$_ZN18wxAcceleratorArrayC1Ev[wxAcceleratorArray::wxAcceleratorArray()]+0xd):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxBaseArrayPtrVoid::wxBaseArrayPtrVoid()'
obj\Debug\main.o(.text$_ZN10wxMenuBaseC2ERK8wxStringl[wxMenuBase::wxMenuBase(wxString const&, long)]+0x43):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEvtHandler::wxEvtHandler()'
obj\Debug\main.o(.text$_ZN10wxMenuBaseC2ERK8wxStringl[wxMenuBase::wxMenuBase(wxString const&, long)]+0x111): In function `ZN7MyFrameC2EP7wxFrameRK8wxString':
C:/Documents and Settings/Darus/My Documents/Work/Active_Projects/Chimecho/Test/main.cpp:38: undefined reference to `wxEvtHandler::~wxEvtHandler()'
obj\Debug\main.o(.text$_ZN14wxMenuItemListD1Ev[wxMenuItemList::~wxMenuItemList()]+0x16): In function `ZNK12wxWindowBase8GetLabelEv':
C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxListBase::~wxListBase()'
obj\Debug\main.o(.text$_ZN10wxListBaseC2E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x45):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `vtable for wxListBase'
obj\Debug\main.o(.text$_ZN10wxListBaseC2E9wxKeyType[wxListBase::wxListBase(wxKeyType)]+0x5e):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxListBase::Init(wxKeyType)'
obj\Debug\main.o(.text$_ZN8wxObjectD2Ev[wxObject::~wxObject()]+0xb):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `vtable for wxObject'
obj\Debug\main.o(.text$_ZN8wxObjectD2Ev[wxObject::~wxObject()]+0x16):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxObject::UnRef()'
obj\Debug\main.o(.text$_ZN8wxObjectC2Ev[wxObject::wxObject()]+0x8):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `vtable for wxObject'
obj\Debug\main.o(.text$_ZN12wxStringBaseC2ERKS_[wxStringBase::wxStringBase(wxStringBase const&)]+0x40):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxAssert(int, wchar_t const*, int, wchar_t const*, wchar_t const*)'
obj\Debug\main.o(.text$_ZN12wxStringBase4InitEv[wxStringBase::Init()]+0x7):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEmptyString'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x38):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxObject::CreateRefData() const'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x3c):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x40):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x44):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x58):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x5c):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEvtHandler::DoGetClientObject() const'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x60):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEvtHandler::DoSetClientData(void*)'
obj\Debug\main.o(.rdata$_ZTV7MyFrame[vtable for MyFrame]+0x64):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxEvtHandler::DoGetClientData() const'
obj\Debug\main.o(.rdata$_ZTV14wxMenuItemList[vtable for wxMenuItemList]+0x8):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxObject::GetClassInfo() const'
obj\Debug\main.o(.rdata$_ZTV14wxMenuItemList[vtable for wxMenuItemList]+0x38):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxObject::CreateRefData() const'
obj\Debug\main.o(.rdata$_ZTV14wxMenuItemList[vtable for wxMenuItemList]+0x3c):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'
obj\Debug\main.o(.text$_ZNK14wxMenuItemList4FindERK9wxListKey[wxMenuItemList::Find(wxListKey const&) const]+0x14):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxListBase::Find(wxListKey const&) const'
obj\Debug\main.o(.text$_ZN20wxwxMenuItemListNodeC1EP10wxListBasePS_S2_P10wxMenuItemRK9wxListKey[wxwxMenuItemListNode::wxwxMenuItemListNode(wxListBase*, wxwxMenuItemListNode*, wxwxMenuItemListNode*, wxMenuItem*, wxListKey const&)]+0x30):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxNodeBase::wxNodeBase(wxListBase*, wxNodeBase*, wxNodeBase*, void*, wxListKey const&)'
obj\Debug\main.o(.text$_ZN14wxMenuItemListD0Ev[wxMenuItemList::~wxMenuItemList()]+0x16):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxListBase::~wxListBase()'
obj\Debug\main.o(.text$_ZN18wxAcceleratorTableaSERKS_[wxAcceleratorTable::operator=(wxAcceleratorTable const&)]+0x2a):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxObject::Ref(wxObject const&)'
obj\Debug\main.o(.text$_ZN8wxStringaSERKS_[wxString::operator=(wxString const&)]+0x14):C:/Program Files/wxWidgets/include/wx/string.h: undefined reference to `wxStringBase::operator=(wxStringBase const&)'
obj\Debug\app.o(.text+0x4c): In function `ZN8wxObject19ReservedObjectFunc3Ev':
C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
obj\Debug\app.o(.text$_ZN12wxAppConsole11GetInstanceEv[wxAppConsole::GetInstance()]+0x4):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxAppConsole::ms_appInstance'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x38):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxObject::CreateRefData() const'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x3c):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x40):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x44):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x4c):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxEvtHandler::TryParent(wxEvent&)'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x58):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x5c):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxEvtHandler::DoGetClientObject() const'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x60):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxEvtHandler::DoSetClientData(void*)'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x64):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxEvtHandler::DoGetClientData() const'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0x9c):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxAppConsole::OnCmdLineHelp(wxCmdLineParser&)'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0xa0):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxAppConsole::OnCmdLineError(wxCmdLineParser&)'
obj\Debug\app.o(.rdata$_ZTV5MyApp[vtable for MyApp]+0xa4):C:/Program Files/wxWidgets/include/wx/object.h: undefined reference to `wxAppConsole::CreateLogTarget()'

What am I doing wrong? I thought that creating wxWidgets application with CodeBlocks is quite straitforward, but it seems it's not  :(
« Last Edit: October 08, 2006, 04:51:17 pm by darus »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Failing to build default wxWidgets project
« Reply #1 on: October 08, 2006, 05:15:32 pm »
The wxWidgets wizard currently does not work for non-monolithic builds...
Be patient!
This bug will be fixed soon...

Offline darus

  • Multiple posting newcomer
  • *
  • Posts: 14
Re: Failing to build default wxWidgets project
« Reply #2 on: October 08, 2006, 06:01:57 pm »
Finally managed to build that damned project  8)

My mistake was that I placed wxWidgets libraries AFTER all the windows API libraries in the build options dialog. It works only if wxWidgets libraries are placed BEFORE all API libraries.
« Last Edit: October 08, 2006, 06:04:07 pm by darus »