[opensuse] Cross-compile C++ on amd64 to i386
I can cross-compile C code on an amd64 system to get an i386 binary without problems with the command 'gcc -m32 -o frotz frotz.c'. But doing something similar with C++ code fails at the link stage: --- frotz.cpp --- #include <iostream> int main() { std::cout << "hello world" << std::endl; } ----------------- $ g++ -m32 -o frotz frotz.cpp /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.1.2/libstdc++.so when searching for -lstdc++ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.1.2/libstdc++.a when searching for -lstdc++ /usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status I'm on openSUSE 10.2. Am I missing some package? I have these packages related to libstdc++ installed: $ rpm -qa *libstdc++* libstdc++41-32bit-4.1.2_20061115-5 libstdc++41-devel-4.1.2_20061115-5 libstdc++-devel-4.1.3-29 libstdc++41-4.1.2_20061115-5 compat-libstdc++-5.0.7-41 Thanks for any pointers. -- Hannes -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Oct 3 2007 11:36, Johannes Sixt wrote:
I can cross-compile C code on an amd64 system to get an i386 binary without problems with the command 'gcc -m32 -o frotz frotz.c'. But doing something similar with C++ code fails at the link stage:
Well go install libstdc++41-devel-32bit.
$ rpm -qa *libstdc++* libstdc++41-32bit-4.1.2_20061115-5 libstdc++41-devel-4.1.2_20061115-5 libstdc++-devel-4.1.3-29 libstdc++41-4.1.2_20061115-5 compat-libstdc++-5.0.7-41 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Jan Engelhardt schrieb:
On Oct 3 2007 11:36, Johannes Sixt wrote:
I can cross-compile C code on an amd64 system to get an i386 binary without problems with the command 'gcc -m32 -o frotz frotz.c'. But doing something similar with C++ code fails at the link stage:
Well go install libstdc++41-devel-32bit.
$ rpm -qa *libstdc++* libstdc++41-32bit-4.1.2_20061115-5 libstdc++41-devel-4.1.2_20061115-5 libstdc++-devel-4.1.3-29 libstdc++41-4.1.2_20061115-5 compat-libstdc++-5.0.7-41
Thanks, that works! Don't know how I missed that one. -- Hannes -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (2)
-
Jan Engelhardt
-
Johannes Sixt