[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: c++ cross compiling for 32 bit
From: |
Bert |
Subject: |
Re: c++ cross compiling for 32 bit |
Date: |
13 Mar 2007 05:29:27 -0700 |
User-agent: |
G2/1.0 |
On Mar 8, 10:59 pm, Paul Pluzhnikov <ppluzhnikov-...@charter.net>
wrote:
> Robert Heller <hel...@deepsoft.com> writes:
> >> I'm trying to find the right cc and linker flags to generate a 32-bit
> >> version of my program.
>
> The correct command is 'g++ -m32 hello.cpp -o hello'
>
> You should *always* use correct compiler driver -- 'g++' for C++,
> 'gcc' for C. Contrary to popular belief they are not the same thing.
>
> > By default, most (all?) of the 64-bit x86 Linux distros only include
> > the 64-bit development packages.
>
> The exact opposite is true for all distributions I know of.
> The OP clearly *has* 32-bit development package; if he didn't the
> error would have been something like: "ld: can't find -lc library".
>
> Cheers,
> --
> In order to understand recursion you must first understand recursion.
> Remove /-nsp/ for email.
Thanks for the responses. I did find after posting my question that I
was using the wrong linker, switching to g++ helped. But I did have
to move some files from /usr/lib64/gcc/x86_64-suse-linux/4.0.2/32 one
level up. And also copy crt?.o from /usr/lib to /usr/lib64 to get my
file to link correctly. Even with the "-m32" flag, the system kept
looking in the "64" directories for libraries and the "crt?.o" files.
The better thing to do seems to be to set up different boot
environments.