Cannot compile wxWidgets 2.9.3 under Ubuntu 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
Muetdhiver
Super wx Problem Solver
Super wx Problem Solver
Posts: 323
Joined: Sun Jun 08, 2008 11:59 am
Location: Bordeaux, France

Cannot compile wxWidgets 2.9.3 under Ubuntu

Post by Muetdhiver » Fri Dec 30, 2011 8:01 pm

Hi !

I want to compile wxWidgets 2.9.3 under ubuntu with g++ to produce 32 bits static libraries. But my OS is Ubuntu 64 bits. So, I use this cross compilation method given in the wiki page :

http://wiki.wxwidgets.org/Cross-Compili ... 64_machine

To achieve this, following the instruction, I use this configure command :

Code: Select all

../configure CC='gcc -m32' CXX='g++ -m32' --libdir=/usr/lib32 --disable-shared 
to tell gcc and g++ to produce 32 bits libraries, and disable-shared to produce static libraries (that is not the subject of this post...).

Then, I run make.
I've got the following error when producing wxrc :
g++ -m32 -o wxrc wxrc_wxrc.o -L/home/zzzz/Applications/wxWidgets-2.9.3/build32/lib -pthread -lwx_baseu_xml-2.9 -lexpat -lwx_baseu-2.9 -lwxzlib-2.9 -lwxregexu-2.9 -pthread -ldl -lm -ldl -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6.1/libstdc++.a when searching for -lstdc++
I understand the problem: when using -ldl, g++ is searching for the standard library stdc++ into my /usr/lib/gcc/x86_64-linux-gnu/4.6.1/ directory, but this one is the 64 bits one.
How tell g++ to take the 32 bits, giving the fact I don't know where it is ? Maybe I missed something in the configure step, could you help me please ?

Thanks to all.

Bye.
OS: Ubuntu 11.10
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3

Muetdhiver
Super wx Problem Solver
Super wx Problem Solver
Posts: 323
Joined: Sun Jun 08, 2008 11:59 am
Location: Bordeaux, France

Re: Cannot compile wxWidgets 2.9.3 under Ubuntu

Post by Muetdhiver » Fri Dec 30, 2011 8:32 pm

I found a solution : installing g++-multilib solved my problem.

Really sad that the wiki page is not speaking about this.
OS: Ubuntu 11.10
Compiler: g++ 4.6.1 (Eclipse CDT Indigo)
wxWidgets: 2.9.3

Post Reply