link problem Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
zeilhans
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Jul 01, 2007 2:00 pm

link problem

Post by zeilhans »

Hi all,

Starting with wxWidgets and Code::Blocks I have the following linker problem:

:: === test, Debug ===
obj\Debug\testApp.o:: In function `ZN12wxAppConsole16OnFatalExceptionEv':C:/wxWidgets-2.8.4/include/wx/app.h:(.rdata$_ZTV7testApp[vtable for testApp]+0x44): undefined reference to `wxApp::Initialize(int&, char**)'
:C:\wxWidgets-2.8.4\include\wx\app.h:(.rdata$_ZTV7testApp[vtable for testApp]+0x90):: undefined reference to `wxAppConsole::OnAssertFailure(char const*, int, char const*, char const*, char const*)'
:C:\wxWidgets-2.8.4\include\wx\app.h:(.rdata$_ZTV7testApp[vtable for testApp]+0x94):: undefined reference to `wxAppConsole::OnAssert(char const*, int, char const*, char const*)'
obj\Debug\testMain.o:: In function `ZNK12wxWindowBase10GetMinSizeEv':C:/wxWidgets-2.8.4/include/wx/window.h:(.text$_ZN12wxStringBase10ConcatSelfEjPKc[wxStringBase::ConcatSelf(unsigned int, char const*)]+0x22): undefined reference to `_imp___ZN12wxStringBase10ConcatSelfEjPKcj'
)]+0x27):: undefined reference to `_imp___ZN12wxStringBase8InitWithEPKcjj'
)]+0x47):: undefined reference to `_imp___Z10wxOnAssertPKciS0_S0_S0_
:: === Build finished: 4 errors, 0 warnings ===


I am using wxWidgets-2.8.4, compiled with mingw32 with the following options: USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug/release UNICODE=1

I use Code::Blocks svn 4161 on Windows XP.

I would be grateful if someone could help me with this problem!?!


Zeilhans
posta10100
Earned some good credits
Earned some good credits
Posts: 106
Joined: Tue Jan 09, 2007 2:27 pm
Location: Italy

Post by posta10100 »

I don't know the code::blocks ide but I think that you have this error because your ide don't know where the libs are.
Try to find in the help or on the web site how to add a library to the ide.

I had this kind of error with wxdev-cpp and I solve it putting the path of the libraries to the right place!
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

You did not link against the right libs, or forgot to define something

Did you use a C::B nightly, with the wxWidgets wizard? Did you install and build wxWidgets correctly?
zeilhans
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Jul 01, 2007 2:00 pm

Post by zeilhans »

Thank you for your reaction:


I use a nightly build from Code::Blocks., from june 23.

I compiled wxWidgets with mingw32, a debug build and a release build.

So i started Code::Blocks and openend a new project with the wxWidgets wizard. I didn't ad any coding, but build the basic framework to see if compiling and linking went on ok.
Compiling was without errors, but linking gave me the 4 errors shown before.
i realy dont know where to look for an error

Zeilhans
Auria
Site Admin
Site Admin
Posts: 6695
Joined: Thu Sep 28, 2006 12:23 am
Contact:

Post by Auria »

zeilhans wrote:Thank you for your reaction:


I use a nightly build from Code::Blocks., from june 23.

I compiled wxWidgets with mingw32, a debug build and a release build.

So i started Code::Blocks and openend a new project with the wxWidgets wizard. I didn't ad any coding, but build the basic framework to see if compiling and linking went on ok.
Compiling was without errors, but linking gave me the 4 errors shown before.
i realy dont know where to look for an error

Zeilhans
If you have used the wizard, and you think you installed wxWidgets correctly, then you should post on the C::B forum about a failure of the wizard.

Usually i'd advise to use wx-config, but it doesn't work on windows AFAIK (why does the windows version seem to always cause that much linking problems other platforms don't have?? :? ) so i'll need to let windows experts answer (or look for the apparently unofficial wx-config for windows here : http://wxconfig.googlepages.com/ - but from there i can't help you any more)
biplab
I live to help wx-kind
I live to help wx-kind
Posts: 194
Joined: Fri Feb 17, 2006 4:16 am
Location: Singapore
Contact:

Post by biplab »

You've compiled wx in Unicode mode and it seems that you are compiling your app in Non-Unicode mode.

Please check Enable Unicode in the Code::Blocks wxWidgets wizard to generate a new project and compile it.
Blog: http://biplab.in

IDE: Code::Blocks
Compilers: GCC, MSVC, etc. ;)
OS: WinXP-SP2 & Linux.
zeilhans
In need of some credit
In need of some credit
Posts: 3
Joined: Sun Jul 01, 2007 2:00 pm

Post by zeilhans »

It took me some time to find the switch but is was the solution of this problem. Thank you very much!!!


Zeilhans
Post Reply