Author Topic: How to run "Hello World" of WxWidgets on CodeBlocks? (working in command line)  (Read 8652 times)

Offline robertoneto123

  • Single posting newcomer
  • *
  • Posts: 4
Hello,

I just reinstall my computer, and I'm trying to run the basic Hello World of Code::Blocks on my system.

I can compile it.

When I do on command line:

g++ -o test tempwxwidgetsApp.o  tempwxwidgetsMain.o `wx-config --libs`
(the .o files were generated by Code Blocks)

It works.

On Code::Blocks, I got some errors. I have the `wx-config --libs` on Build Options / Linker settings / Other Liker Options.

Is there a way to know how CodeBlocks is calling g++?

Does anyone knows how to solve this problem?

obj/Debug/tempwxwidgetsApp.o||In function `wxGetApp()':|
/home/roberto/temp/tempwxwidgets/tempwxwidgetsApp.cpp|21|undefined reference to `wxAppConsole::ms_appInstance'|
obj/Debug/tempwxwidgetsApp.o||In function `wxAppConsole::SetInitializerFunction(wxAppConsole* (*)())':|
/usr/include/wx-2.8/wx/app.h|279|undefined reference to `wxAppConsole::ms_appInitFn'|
obj/Debug/tempwxwidgetsApp.o||In function `wxGetTranslation':|
/usr/include/wx-2.8/wx/intl.h|581|undefined reference to `wxGetLocale()'|
obj/Debug/tempwxwidgetsApp.o||In function `wxStringBase':|
/usr/include/wx-2.8/wx/string.h|368|undefined reference to `wxStringBase::npos'|
/usr/include/wx-2.8/wx/string.h|368|undefined reference to `wxStringBase::InitWith(wchar_t const*, unsigned int, unsigned int)'|
obj/Debug/tempwxwidgetsApp.o||In function `main':|
/home/roberto/temp/tempwxwidgets/tempwxwidgetsApp.cpp|21|undefined reference to `wxEntry(int&, char**)'|
obj/Debug/tempwxwidgetsApp.o||In function `wxCreateApp()':|
/home/roberto/temp/tempwxwidgets/tempwxwidgetsApp.cpp|21|undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'|
obj/Debug/tempwxwidgetsApp.o||In function `tempwxwidgetsApp':|
/home/roberto/temp/tempwxwidgets/tempwxwidgetsApp.h|16|undefined reference to `wxApp::wxApp()'|
obj/Debug/tempwxwidgetsApp.o||In function `~wxThreadHelperThread':|
/usr/include/wx-2.8/wx/thread.h|594|undefined reference to `wxThread::~wxThread()'|
/usr/include/wx-2.8/wx/thread.h|594|undefined reference to `wxThread::~wxThread()'|
obj/Debug/tempwxwidgetsApp.o||In function `wxTransform2D::InverseTransform(wxRect2DInt*) const':|
/usr/include/wx-2.8/wx/geometry.h|803|undefined reference to `wxRect2DInt::operator=(wxRect2DInt const&)'|
obj/Debug/tempwxwidgetsApp.o||In function `wxTransform2D::Transform(wxRect2DInt*) const':|
/usr/include/wx-2.8/wx/geometry.h|794|undefined reference to `wxRect2DInt::operator=(wxRect2DInt const&)'|
obj/Debug/tempwxwidgetsApp.o||In function `~tempwxwidgetsApp':|
/home/roberto/temp/tempwxwidgets/tempwxwidgetsApp.h|16|undefined reference to `wxApp::~wxApp()'|
/home/roberto/temp/tempwxwidgets/tempwxwidgetsApp.h|16|undefined reference to `wxApp::~wxApp()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x8)||undefined reference to `wxApp::GetClassInfo() const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x14)||undefined reference to `wxObject::CreateRefData() const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x18)||undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x1c)||undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x20)||undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x28)||undefined reference to `wxEvtHandler::TryParent(wxEvent&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x2c)||undefined reference to `wxApp::GetEventTable() const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x30)||undefined reference to `wxApp::GetEventHashTable() const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x34)||undefined reference to `wxEvtHandler::DoSetClientObject(wxClientData*)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x38)||undefined reference to `wxEvtHandler::DoGetClientObject() const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x3c)||undefined reference to `wxEvtHandler::DoSetClientData(void*)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x40)||undefined reference to `wxEvtHandler::DoGetClientData() const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x44)||undefined reference to `wxApp::Initialize(int&, wchar_t**)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x50)||undefined reference to `wxApp::OnInitGui()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x54)||undefined reference to `wxAppBase::OnRun()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x58)||undefined reference to `wxAppBase::OnExit()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x5c)||undefined reference to `wxApp::CleanUp()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x64)||undefined reference to `wxAppBase::Exit()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x68)||undefined reference to `wxAppBase::OnInitCmdLine(wxCmdLineParser&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x6c)||undefined reference to `wxAppBase::OnCmdLineParsed(wxCmdLineParser&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x70)||undefined reference to `wxAppConsole::OnCmdLineHelp(wxCmdLineParser&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x74)||undefined reference to `wxAppConsole::OnCmdLineError(wxCmdLineParser&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x78)||undefined reference to `wxAppConsole::FilterEvent(wxEvent&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x7c)||undefined reference to `wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x84)||undefined reference to `wxAppConsole::ProcessPendingEvents()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x88)||undefined reference to `wxApp::Yield(bool)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x8c)||undefined reference to `wxApp::WakeUpIdle()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x90)||undefined reference to `wxAppBase::CreateTraits()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x94)||undefined reference to `wxAppBase::MainLoop()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x98)||undefined reference to `wxAppBase::ExitMainLoop()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0x9c)||undefined reference to `wxAppBase::Pending()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0xa0)||undefined reference to `wxAppBase::Dispatch()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0xa4)||undefined reference to `wxAppBase::ProcessIdle()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0xa8)||undefined reference to `wxAppBase::SendIdleEvents(wxWindow*, wxIdleEvent&)'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0xac)||undefined reference to `wxAppBase::OnExceptionInMainLoop()'|
obj/Debug/tempwxwidgetsApp.o:(.rodata._ZTV16tempwxwidgetsApp[vtable for tempwxwidgetsApp]+0xb4)||undefined reference to `wxAppBase::GetTopWindow() const'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

Offline robertoneto123

  • Single posting newcomer
  • *
  • Posts: 4
I figure it out a way to solve, but I believe that there is a nicer way... if anyone can help...

I just manually add all libraries from /usr/lib/libwx...... to the project.

I believe that is not the best way, but it solve... is there a better way?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Macros

  • Single posting newcomer
  • *
  • Posts: 2
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.html
No, 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):

Code
-------------- 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 :P (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.
« Last Edit: August 31, 2012, 03:33:37 pm by Macros »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Firstly, i wanted to use wxSmith and start from wxWidgets Project template. Unfortunately it is eighter broken atm for windows
A lot people use it and it works perfectly fine.

Code
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':
Sorry, but this makes absolutely no sense. You don't even provide any required wxWidgets compiler flags to define the flavour you self-compiled your wxWidgets with, neither you link against any required wxWidgets lib you need, again depending on the flavour you compiled wxWidgets with.

It seems you lack very basic knowledge about how to use frameworks / SDK's in applications. I'd suppose you first start with reading the developer guide of wxWidgets, then try a hello world on the command line (maybe use the samples provided by wxWidgets with make) and then start with an IDE. An IDE generally is as good as you are - if you don't know how to compile an application that uses a certain 3rd party SDK any IDE won't know, too.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Macros

  • Single posting newcomer
  • *
  • Posts: 2
Well, thx for help, however obscure and cryptic it wasn't.
Yeah, i lack some basics, just like many ppl here asking for help.
Unfortunately, neither C++ Primer Plus nor none of my lecturers cared to explaing some things properly.
When it comes to hello world, imho, there should be enough information to write it without too much hassle, where to put what and why
and not "on linux you can use... (commad with a bunch of scripts added here)"
I've read most of the provided documentation from wxWidgets.
The one included in package(not too much, some instalation notes, some libraries that may or may not be used, tried including them all and a little more, it didn't help).
And that on their site, http://docs(dot)wxwidgets(dot)org/stable/wx_contents(dot)html , can't argue that there's some info yet still far from being usefull.
I've used Irrlicht and a little of Android SDK and had no bigger problems with them, but meaby it's not what you call framework/SDK, dunno.

Thx anyway. After all if you say there certainly is no problem with wxWidgets template for windows with wxSmith, there is nothing more in my post that relevant to this forum :) .

Ps. Sorry for my poor engrish.

EDIT://
I'll just stick to learning by experience, so far it worked the best.
EDIT://
Weird, i have no problems with SDL eighter, there's everything needed to launch it described in their docs :S
(although c::b sdl template also spams me for env var for no reason)
« Last Edit: September 02, 2012, 03:53:49 am by Macros »