User forums > Help
wxWidgets Sample compiling error
Ceniza:
BUILD=debug will create a big library that you can debug (I don't really think you want that).
BUILD=release will create a smaller library with optimizations that you won't be able to debug (except if you feel like debugging asm code). However, you'll be able to debug your own code, so don't worry about it.
cs378:
Hi I rebuild everything. with monolithic and share
And it compiled the sample of wxWidgets given by Code::Blocks. Ran perfectly :P
Thank You all for helping me understand the different options.
Now its time learn the use of wxWidgets. I found:
http://www.wxwidgets.org/docs/tutorials/hello.htm
It seems like a good start. So I copied the code and compile it in an empty project.
and boom i got errors again :(
--- Code: ----------------- Build: Release in wxHelloWorld ---------------
Compiling: wxHelloWorld.cpp
Linking console executable: bin\Release\wxHelloWorld.exe
Info: resolving wxFrame::sm_eventTable by linking to __imp___ZN7wxFrame13sm_eventTableE (auto-import)
Info: resolving _wxEmptyString by linking to __imp__wxEmptyString (auto-import)
Info: resolving vtable for wxwxMenuItemListNodeby linking to __imp___ZTV20wxwxMenuItemListNode (auto-import)
Info: resolving wxAppConsole::ms_appInstance by linking to __imp___ZN12wxAppConsole14ms_appInstanceE (auto-import)
Info: resolving wxStringBase::npos by linking to __imp___ZN12wxStringBase4nposE (auto-import)
Info: resolving _wxFrameNameStr by linking to __imp__wxFrameNameStr (auto-import)
Info: resolving vtable for wxFrameby linking to __imp___ZTV7wxFrame (auto-import)
Info: resolving vtable for wxMenuBaseby linking to __imp___ZTV10wxMenuBase (auto-import)
Info: resolving vtable for wxListBaseby linking to __imp___ZTV10wxListBase (auto-import)
Info: resolving vtable for wxMenuby linking to __imp___ZTV6wxMenu (auto-import)
Info: resolving _wxStatusLineNameStr by linking to __imp__wxStatusLineNameStr (auto-import)
Info: resolving vtable for wxObjectby linking to __imp___ZTV8wxObject (auto-import)
Info: resolving _wxEVT_COMMAND_MENU_SELECTED by linking to __imp__wxEVT_COMMAND_MENU_SELECTED (auto-import)
Info: resolving _wxEVT_NULL by linking to __imp__wxEVT_NULL (auto-import)
Info: resolving wxAppConsole::ms_appInitFn by linking to __imp___ZN12wxAppConsole12ms_appInitFnE (auto-import)
obj\Release\wxHelloWorld.o:wxHelloWorld.cpp:(.text+0x197): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Release\wxHelloWorld.o:wxHelloWorld.cpp:(.text+0x33d): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Release\wxHelloWorld.o:wxHelloWorld.cpp:(.text+0x370): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Release\wxHelloWorld.o:wxHelloWorld.cpp:(.text+0x421): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Release\wxHelloWorld.o:wxHelloWorld.cpp:(.text+0x454): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Release\wxHelloWorld.o:wxHelloWorld.cpp:(.text+0x505): more undefined references to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)' follow
obj\Release\wxHelloWorld.o:wxHelloWorld.cpp:(.rdata$_ZTV15wxHelloWorldApp[vtable for wxHelloWorldApp]+0x44): undefined reference to `wxApp::Initialize(int&, char**)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 7 seconds)
6 errors, 0 warnings
--- End code ---
MortenMacFly:
--- Quote from: cs378 on September 14, 2007, 11:22:31 pm ---It seems like a good start. So I copied the code and compile it in an empty project.
and boom i got errors again :(
--- End quote ---
Maybe before start using a framework like wx it's better to understand how a compiler and linker works. And what parameters you have to provide to the compiler and linker. An empty project has *no* options setup. How should C::B - and therefor the compiler/linker know against what to compile/link, where to search for things and so on. You (!) have to provide that information.
I really suggest you try the following: Try to compile a simple "hello wx world" thing from the *command line* without any IDE. Once this works go back to C::B, setup your project accordingly and use the fancy stuff an IDE provides you with correctly.
With regards, Morten.
Navigation
[0] Message Index
[*] Previous page
Go to full version