Hello.
So.. i have the same problem.
Firstly, i wanted to use wxSmith and start from wxWidgets Project template. Unfortunately it is eighter broken atm for windows or no one on the internet (or at least no one i found through google) can help with solving issues with it. Also the guid on c::b wiki is eighter old or works only for linux (idk i'm windows users, but fairly recent videos from yt shows that it's just different for linux).
Here is a topic on this forum that describes the problem with wxSmith:
http://forums.codeblocks.org/index.php/topic,16077.15.htmlNo, i didn't write it, of cours. I even though about putting few of my own advices there
(for ex. about how i find setting path through batch file unconvenient especially when you could tell him that he can find it in mycomputer settings and easily back it up first [as he said he messed his path despite the neat batch file given].. and you can use MinGW installer to do it for you. What is more all he solved in that topic was compiling his wxWidgets and i don't want to accuse anyone of anything but it seems he didn't read the readme provided with the package)
but the topic is fairly old and when i saw the warning that you may not like necro posts.. and what i had to say wouldn't solve the problem anyway so.. .
Anyway, i couldn't use the template so i wanted to try writing the hello world provided by wxWidgets (another advice for that guy, he seemed to be unaware that he could code it without any resource editor or templates as there are tutorials on the net... but hey, if it would be so easy i wouldn't post my problem here
)
and ran into the same problem as described in the topic.
So here's my build log dump (with Full Compiler Logging, which is btw on by default and person that made the topic probably simply dumped Build Messages instead of Build Log):
-------------- Clean: Debug in 1 Starter Project (compiler: GNU GCC Compiler)---------------
Cleaned "1 Starter Project - Debug"
-------------- Build: Debug in 1 Starter Project (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -g -I..\..\..\wxWidgets-2.8.12\include -I..\..\..\wxWidgets-2.8.12\lib\gcc_lib\mswud -c "C:\Main\Duperele\Programowanie\progr\Projekty\wxWidgets Projects\1 Starter Project\Main.cpp" -o obj\Debug\Main.o
mingw32-g++.exe -L..\..\..\wxWidgets-2.8.12\lib\gcc_lib\mswud -o "bin\Debug\1 Starter Project.exe" obj\Debug\Main.o
obj\Debug\Main.o: In function `_Z11wxCreateAppv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
obj\Debug\Main.o: In function `WinMain':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:287: undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
obj\Debug\Main.o: In function `_ZN7MyFrameC2ERK8wxStringRK7wxPointRK6wxSize':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:44: undefined reference to `_wxEmptyString'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:46: undefined reference to `_wxEmptyString'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:48: undefined reference to `wxMenuBar::wxMenuBar()'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:51: undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:53: undefined reference to `_wxStatusLineNameStr'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:53: undefined reference to `wxFrameBase::CreateStatusBar(int, long, int, wxString const&)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:54: undefined reference to `wxFrameBase::SetStatusText(wxString const&, int)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:54: undefined reference to `wxFrame::~wxFrame()'
obj\Debug\Main.o: In function `_ZN7MyFrameC1ERK8wxStringRK7wxPointRK6wxSize':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:44: undefined reference to `_wxEmptyString'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:46: undefined reference to `_wxEmptyString'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:48: undefined reference to `wxMenuBar::wxMenuBar()'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:51: undefined reference to `wxFrameBase::SetMenuBar(wxMenuBar*)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:53: undefined reference to `_wxStatusLineNameStr'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:53: undefined reference to `wxFrameBase::CreateStatusBar(int, long, int, wxString const&)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:54: undefined reference to `wxFrameBase::SetStatusText(wxString const&, int)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:54: undefined reference to `wxFrame::~wxFrame()'
obj\Debug\Main.o: In function `_ZN7MyFrame6OnQuitER14wxCommandEvent':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:59: undefined reference to `wxWindowBase::Close(bool)'
obj\Debug\Main.o: In function `_ZN7MyFrame7OnAboutER14wxCommandEvent':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:64: undefined reference to `wxMessageBox(wxString const&, wxString const&, long, wxWindow*, int, int)'
obj\Debug\Main.o: In function `_Z41__static_initialization_and_destruction_0ii':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:25: undefined reference to `wxEventHashTable::wxEventHashTable(wxEventTable const&)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:28: undefined reference to `_wxEVT_COMMAND_MENU_SELECTED'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:28: undefined reference to `_wxEVT_COMMAND_MENU_SELECTED'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:28: undefined reference to `_wxEVT_NULL'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:25: undefined reference to `wxEventHashTable::~wxEventHashTable()'
obj\Debug\Main.o: In function `_ZNK9wxAppBase8IsActiveEv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/../../../wxWidgets-2.8.12/include/wx/app.h:(.rdata+0x0): undefined reference to `wxFrame::sm_eventTable'
obj\Debug\Main.o: In function `_ZNK7MyFrame17GetEventHashTableEv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:25: undefined reference to `wxApp::wxApp()'
obj\Debug\Main.o: In function `_ZNK9wxAppBase8IsActiveEv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/../../../wxWidgets-2.8.12/include/wx/app.h:(.text$_ZN12wxAppConsole11GetInstanceEv[wxAppConsole::GetInstance()]+0x4): undefined reference to `wxAppConsole::ms_appInstance'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/../../../wxWidgets-2.8.12/include/wx/app.h:(.text$_ZN12wxStringBaseC2EPKc[wxStringBase::wxStringBase(char const*)]+0x7): undefined reference to `wxStringBase::npos'
obj\Debug\Main.o: In function `_Z11wxCreateAppv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Debug\Main.o: In function `_ZNK9wxAppBase8IsActiveEv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/../../../wxWidgets-2.8.12/include/wx/app.h:(.text$_Z16wxGetTranslationPKcS0_[wxGetTranslation(char const*, char const*)]+0x7): undefined reference to `wxGetLocale()'
obj\Debug\Main.o: In function `_Z11wxCreateAppv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `_wxEmptyString'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `_wxEmptyString'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxMenuItemBase::New(wxMenu*, int, wxString const&, wxString const&, wxItemKind, wxMenu*)'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `vtable for wxMenu'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxMenu::Init()'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxMenuBase::~wxMenuBase()'
obj\Debug\Main.o: In function `_ZNK7MyFrame17GetEventHashTableEv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:25: undefined reference to `wxBaseArrayPtrVoid::~wxBaseArrayPtrVoid()'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:25: undefined reference to `wxBaseArrayPtrVoid::wxBaseArrayPtrVoid()'
obj\Debug\Main.o: In function `_Z11wxCreateAppv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxEvtHandler::wxEvtHandler()'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `vtable for wxMenuBase'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxMenuBase::Init(long)'
obj\Debug\Main.o: In function `WinMain':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:287: undefined reference to `wxEvtHandler::~wxEvtHandler()'
obj\Debug\Main.o: In function `_Z11wxCreateAppv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxListBase::~wxListBase()'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `vtable for wxListBase'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxListBase::Init(wxKeyType)'
obj\Debug\Main.o: In function `_ZNK7MyFrame17GetEventHashTableEv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:25: undefined reference to `vtable for wxObject'
obj\Debug\Main.o: In function `_Z11wxCreateAppv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/Main.cpp:30: undefined reference to `wxObject::UnRef()'
obj\Debug\Main.o: In function `_ZNK9wxAppBase8IsActiveEv':
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/../../../wxWidgets-2.8.12/include/wx/app.h:(.text$_ZN8wxObjectC2Ev[wxObject::wxObject()]+0x8): undefined reference to `vtable for wxObject'
C:/Main/Duperele/Programowanie/progr/Projekty/wxWidgets Projects/1 Starter Project/../../../wxWidgets-2.8.12/include/wx/app.h:(.text$_ZN12wxStringBase4InitEv[wxStringBase::Init()]+0x7): undefined reference to `_wxEmptyString'
Process terminated with status 1 (0 minutes, 6 seconds)
50 errors, 0 warnings (0 minutes, 6 seconds)
I've added the standart include path and wxWidgets-2.8.12\lib\gcc_lib\mswud which provides setup.h (shouldn't that be somewhere in include folder :S )
and linked something at random
(or at least something i thought that would be usefull to link, i've tried many configurations)
So i'd appreciate if someone could tell me how to link it properly
.
Ps. Meanwhile i think i'll check Qt, seeing that many ppl around have similiar problems to mine and that i found no solution to it.
Any one knows does this whole "MOC" is a good idea to use when i'm still learning the ways of coding in C/C++ ?
Ps.2 When using wxWidgets template, path to wxWidgets is set to $(#wx) by default and although i change it , c::b still seems to look for it there so maybe that's the problem.
EDIT://
Ps.3 Not that there is much more in Build Log with Full Compiler Logging on so meaby i'm doing something wrong too.