undefined reference to wxXmlResource::Get()

CodeLite installation/troubleshooting forum
classic99
CodeLite Curious
Posts: 2
Joined: Sun Nov 30, 2008 9:51 am
Contact:

undefined reference to wxXmlResource::Get()

Post by classic99 »

Hello.

i've downloaded the Codelite & MingW3.4.5 bundle, and downloaded wxWidgets 2.8.9.
I built wxWidgets (while in the wxWidgets\build\msw folder) using:
mingw32-make.exe -f makefile.gcc UNICODE=1 SHARED=0 BUILD=release

and when i try to build a simple GUI App**, I get this:

Code: Select all

Building: 
"mingw32-make.exe"  -j 2 -f "SimpleApp_wsp.mk"
----------Building project:[ MyApp - Release ]----------
g++ -c  "D:/Programming/IDE/CodeLite/Projects/SimpleApp/myapp_frame.cpp" -mthreads -DHAVE_W32API_H -D__WXMSW__ -D_UNICODE -ID:\Programming\IDE\wxWidgets-2.8.9\lib\gcc_lib\mswu -ID:\Programming\IDE\wxWidgets-2.8.9\include -Wno-ctor-dtor-privacy -pipe -fmessage-length=0    -D__WX__  -o ./Release/myapp_frame.o 
g++ -c  "D:/Programming/IDE/CodeLite/Projects/SimpleApp/myapp_app.cpp" -mthreads -DHAVE_W32API_H -D__WXMSW__ -D_UNICODE -ID:\Programming\IDE\wxWidgets-2.8.9\lib\gcc_lib\mswu -ID:\Programming\IDE\wxWidgets-2.8.9\include -Wno-ctor-dtor-privacy -pipe -fmessage-length=0    -D__WX__  -o ./Release/myapp_app.o 
g++ -o ./Release/MyApp ./Release/myapp_app.o ./Release/myapp_frame.o    -O2  -mthreads -LD:\Programming\IDE\wxWidgets-2.8.9\lib\gcc_lib -lwxmsw28u_html -lwxmsw28u_adv -lwxmsw28u_core -lwxbase28u_xml -lwxbase28u_net -lwxbase28u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwxregexu -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32  -mwindows
./Release/myapp_app.o:myapp_app.cpp:(.text+0x278): undefined reference to `wxXmlResource::Get()'
./Release/myapp_app.o:myapp_app.cpp:(.text+0x280): undefined reference to `wxXmlResource::InitAllHandlers()'
collect2: ld returned 1 exit status
mingw32-make.exe[1]: *** [Release/MyApp] Error 1
mingw32-make.exe: *** [All] Error 2
0 errors, 0 warnings, total time: 00:00:03 seconds
----------Build Ended----------
**GUI App made by doing:
1. Create New Workspace
2. Hitting "new wxWidgetProject" in the toolbar
3. Hitting Build Project (F7)

anyone know whats causing this...and hopefully to keep it statically built...
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: undefined reference to wxXmlResource::Get()

Post by eranif »

This is wierd, but it looks like the wx-config tool does not add xrc.

Open the project settings:
right click on your project, select: settings -> linker tab
then: add in the 'Libraries' entry: libwxmsw28u_xrc.a
Click OK, and try to build it again

Eran
Make sure you have read the HOW TO POST thread
classic99
CodeLite Curious
Posts: 2
Joined: Sun Nov 30, 2008 9:51 am
Contact:

Re: undefined reference to wxXmlResource::Get()

Post by classic99 »

that fixed it. thanks :mrgreen:

any idea of how i can make it always add that, or will i just have to add it to every project i make?

sorry for the stupid questions, just switched to CodeLite after almost a year of using Code::Blocks.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: undefined reference to wxXmlResource::Get()

Post by eranif »

It looks like a bug in the wx-config tool which CodeLite uses to produce the libraries & include paths.

You can:
1) Use monolithic build (one big static library)
2) Save the current project as template so you can re-use this exact settings later, to save this:
- Right click on the project and select 'save as template' give it a name and description (recommended)
next time when you want to create new WX project, dont use the CodeLite built-in wizard, but, from the menu bar: Workspace -> Create New Project -> and choose from the list your template project

Eran
Make sure you have read the HOW TO POST thread
Post Reply