Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » compile 32bit on 64bit
compile 32bit on 64bit [message #535425] Sun, 23 May 2010 12:33 Go to next message
Michael Mising name is currently offline Michael Mising nameFriend
Messages: 103
Registered: July 2009
Senior Member
Hi
Can i use my 32bit Eclipse project on a 64bit linux? (updated from opensuse 32bit to ubuntu 64bit)

Anyway I'd need to compile (as for now) only for 32bit. What changes would I need to make to my projectfile?

Many thanks
Michael

Re: compile 32bit on 64bit [message #535644 is a reply to message #535425] Tue, 25 May 2010 06:28 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
To build 32Bit applications on a 64Bit platform you need:
- gcc/g++ with multilib
- ia32-libs (needed to link and run your application)
- in Eclipse you add -m32 to the compiler and linker flags

(see http://www.eclipse.org/forums/index.php?t=msg&goto=51755 8&)

Axel


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: compile 32bit on 64bit [message #536541 is a reply to message #535644] Fri, 28 May 2010 15:51 Go to previous messageGo to next message
Michael Mising name is currently offline Michael Mising nameFriend
Messages: 103
Registered: July 2009
Senior Member
Thanks. I downloaded 64bit cdt and saw the toolchains also for Windows (mingw) and Mac.
Any suggestions/tips for such? In fact I'd need to compile my projects also for Win & Mac.

[Updated on: Sat, 29 May 2010 07:32]

Report message to a moderator

Re: compile 32bit on 64bit [message #536809 is a reply to message #536541] Mon, 31 May 2010 07:11 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
For Windows I would suggest Wascana http://code.google.com/a/eclipselabs.org/p/wascana/
But I am not sure if it is a 64bit version. If not you have to download MinGW64
http://sourceforge.net/projects/mingw-w64/


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: compile 32bit on 64bit [message #537117 is a reply to message #536809] Tue, 01 June 2010 11:37 Go to previous messageGo to next message
Michael Mising name is currently offline Michael Mising nameFriend
Messages: 103
Registered: July 2009
Senior Member
Thanks but do I need those? I supposed to only create a new project file with different toolchain and include locations ( on linux )
For IntelMac only and Win.

[Updated on: Tue, 01 June 2010 11:37]

Report message to a moderator

Re: compile 32bit on 64bit [message #537240 is a reply to message #537117] Tue, 01 June 2010 16:19 Go to previous messageGo to next message
Michael Mising name is currently offline Michael Mising nameFriend
Messages: 103
Registered: July 2009
Senior Member
ahm I also run into problems with the needed SDL and openAL libs. How should I deal with those?
Many thanks
Re: compile 32bit on 64bit [message #537376 is a reply to message #537240] Wed, 02 June 2010 08:52 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Michael wrote on Tue, 01 June 2010 12:19
ahm I also run into problems with the needed SDL and openAL libs. How should I deal with those?
Many thanks


You should install the developer packages. They should be named like this sdl-dev


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: compile 32bit on 64bit [message #537377 is a reply to message #537117] Wed, 02 June 2010 08:54 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Michael wrote on Tue, 01 June 2010 07:37
Thanks but do I need those? I supposed to only create a new project file with different toolchain and include locations ( on linux )
For IntelMac only and Win.

So you want crosscompilation for Mac/Windows on Linux?


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: compile 32bit on 64bit [message #537393 is a reply to message #537377] Wed, 02 June 2010 09:50 Go to previous messageGo to next message
Michael Mising name is currently offline Michael Mising nameFriend
Messages: 103
Registered: July 2009
Senior Member
Axel Mueller wrote on Wed, 02 June 2010 04:54

So you want crosscompilation for Mac/Windows on Linux?


Yes. If it's not to difficult. Well I've updated to ubuntu 64bit but still need to compile for 32bit (and win & Osx)

For SDL libs i wanted to include a different lib (32bit) location but apparently I forgot something alike libconfig or so. I'm stuck there for now. Simply copying from the 32bit linux doesn't work.

I still have opensuse 32bit installed aside but as soon i get this going I'll free that space for something else.

thanks
Re: compile 32bit on 64bit [message #537437 is a reply to message #537393] Wed, 02 June 2010 12:56 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
For Windows crossompilation you need the mingw package. And I recommend installing the crosscompilation feature of the Ecipse CDT plugin .

Quote:
For SDL libs i wanted to include a different lib (32bit) location but apparently I forgot something alike libconfig or so. I'm stuck there for now. Simply copying from the 32bit linux doesn't work.

You have to install the 32Bit version of the libs. Download the 32Bit package (deb file). And then install it from the command line:
sudo dpkg -i --force-all <package_i386.deb>

the force-all option is necessayr to install 32Bit package on a 64bit system.

If you need more libs you can use the package "getlibs" (http://ubuntuforums.org/showthread.php?t=474790)


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google

[Updated on: Wed, 02 June 2010 12:59]

Report message to a moderator

Re: compile 32bit on 64bit [message #537475 is a reply to message #537437] Wed, 02 June 2010 15:05 Go to previous messageGo to next message
Michael Mising name is currently offline Michael Mising nameFriend
Messages: 103
Registered: July 2009
Senior Member
I've simply selected them at install of 10.04.
Now that's the error I get:
------------
g++ -Lmedia/openSuse-/usr/lib/ -m32 -shared -o"lin.xpl" ./main.o -lSDL -lSDL_mixer -lalut -lSDL_image -lGL -lGLU
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.a when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.so when searching for -lSDL
/usr/bin/ld: skipping incompatible /usr/lib/libSDL.a when searching for -lSDL
/usr/bin/ld: cannot find -lSDL
collect2: ld returned 1 exit status
make: *** [lin.xpl] Fehler 1
------
Can I copy the libs from suse to f.ex. /usr/libsSuse32 and then simply run ldconfig from that directory? What about the win & osx libs?
Thanks

[Updated on: Wed, 02 June 2010 15:24]

Report message to a moderator

Re: compile 32bit on 64bit [message #538606 is a reply to message #537475] Tue, 08 June 2010 08:05 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Quote:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libSDL.so when searching for -lSDL

You have the 64bit version only. You need the 32bit version. See my previous comment how to get and install them.


Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: compile 32bit on 64bit [message #538788 is a reply to message #538606] Tue, 08 June 2010 15:50 Go to previous messageGo to next message
Michael Mising name is currently offline Michael Mising nameFriend
Messages: 103
Registered: July 2009
Senior Member
Thanks. This won't break my 64bit libs already installed?

What about Win & Osx?

Re: compile 32bit on 64bit [message #539287 is a reply to message #538788] Thu, 10 June 2010 09:42 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
Quote:
This won't break my 64bit libs already installed?

No. The 64bit libs are located in /usr/lib and the 32bit libs in /usr/lib32.

Quote:
What about Win & Osx?

For Windows cross-compilation you need the MinGW package (gcc compiler for Windows) on Linux.




Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Previous Topic:Programme not giving proper output
Next Topic:running in terminal
Goto Forum:
  


Current Time: Thu Apr 18 05:15:41 GMT 2024

Powered by FUDForum. Page generated in 0.02236 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top