Results 1 to 10 of 10
Hi All,
How can I compile a C++ application using g++ with x86 platform settings on a x86_64 machine ?
What are the possible negative side-effects of compiling a C++ ...
- 01-25-2010 #1Just Joined!
- Join Date
- Nov 2009
- Posts
- 43
compiling a C++ program using g++ with x86 settings
Hi All,
How can I compile a C++ application using g++ with x86 platform settings on a x86_64 machine ?
What are the possible negative side-effects of compiling a C++ application with x86 settings on a x86_64 platform ?
I am using 64-bit Ubuntu 9.10.
Thanks.
- 01-25-2010 #2
I think -m32 will do it
g++ filename -m32 -o filenameMake mine Arch Linux
- 01-25-2010 #3Just Joined!
- Join Date
- Nov 2009
- Posts
- 43
- 01-26-2010 #4Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Well, with the -m32 option (or -m32-bit option) the compiler should pass the 32-bit info to the linker, so it should link with the 32-bit versions. In fact, you are basically building for a 32-bit environment, so all required libraries should be available in their 32-bit version, otherwise you have a 32-bit program that will only run on a 64-bit machine...
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 01-27-2010 #5Just Joined!
- Join Date
- Nov 2009
- Posts
- 43
- 01-27-2010 #6Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Were you using gcc/g++ to do the linkage, or directly going to ln?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 01-28-2010 #7
- 01-28-2010 #8Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Oops, I meant ld not ln. So, you probably needed to add the -Wl,-m32 option to pass to the linker, correct?
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 01-29-2010 #9Just Joined!
- Join Date
- Nov 2009
- Posts
- 43
- 01-29-2010 #10Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,974
Ok. Then if I were you I'd post this issue as a possible bug to the gcc / gnu / FSF web site's bug page. I'd think, personally, that the -w32 option to the compiler should be passed as necessary to the linker.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
