Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Cross compile 32bit and 64bit
Cross compile 32bit and 64bit [message #1386256] Mon, 16 June 2014 08:32 Go to next message
Greg Amerson is currently offline Greg AmersonFriend
Messages: 119
Registered: March 2010
Senior Member
Hello CDT'ers',

I am brand new to CDT just setup my first project and for this simple C project I need to create 2 sets of executes, 32bit and 64bit. I'm working on an Ubuntu machine and using the Linux GCC toolchain. I just need to support Linux systems for my runtime, but need a 32bit and 64bit variety. I know that at low level gcc has an option for '-m32' or '-m64' to compile down to 32bit or 64bit accordingly.

Do CDT build configurations support setting this flag automatically for me (I select some radio button/checkbox) or do I need to go into the build configurations under the miscellaneous and set '-m32' under the GCC C Linker > Miscellaneous > Linker flags entry field? What is the best way to accomplish this?

Thanks!
Re: Cross compile 32bit and 64bit [message #1386277 is a reply to message #1386256] Mon, 16 June 2014 10:21 Go to previous messageGo to next message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member
There is no automatic support. But your approach (two configurations with different compiler settings) is the correct way. Besides the linker settings you must also set the "-m32" flag for the compiler (C and C++).

Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
Re: Cross compile 32bit and 64bit [message #1386356 is a reply to message #1386277] Tue, 17 June 2014 00:33 Go to previous message
Greg Amerson is currently offline Greg AmersonFriend
Messages: 119
Registered: March 2010
Senior Member
Thanks Axel for your confirmation. I was able to get it working just as you said, adding '-m32' or '-m64' in each of the compiler/linker setting configuration pages.
Previous Topic:Eclipse CDT jni.h not found
Next Topic:CDT not working after update
Goto Forum:
  


Current Time: Fri Mar 29 14:03:46 GMT 2024

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

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

Back to the top