help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

c++ cross compiling for 32 bit


From: Bert
Subject: c++ cross compiling for 32 bit
Date: 8 Mar 2007 10:01:14 -0800
User-agent: G2/1.0

Hi,

I'm trying to find the right cc and linker flags to generate a 32-bit
version of my program.  My environement is SuSE 10.2 Linux on a 64-bit
computer.  I try "gcc -m32 hello.cpp -o hello" (hello world program)
and get the following errors:

hello.cpp:(.text+0x27): undefined reference to `std::cout'
hello.cpp:(.text+0x2c): undefined reference to
`std::basic_ostream<char, std::char_traits<char> >& std::operator<<
<std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
/tmp/ccbr0Ju1.o: In function `__tcf_0':
hello.cpp:(.text+0x46): undefined reference to
`std::ios_base::Init::~Init()'
/tmp/ccbr0Ju1.o: In function
`__static_initialization_and_destruction_0(int, int)':
hello.cpp:(.text+0x6f): undefined reference to
`std::ios_base::Init::Init()'
/tmp/ccbr0Ju1.o:(.eh_frame+0x11): undefined reference to
`__gxx_personality_v0'
collect2: ld returned 1 exit status

Any advice on what libraries I'm missing or how to point the linker to
the correct libraries?

Thanks



reply via email to

[Prev in Thread] Current Thread [Next in Thread]