I have very simple (hello world) program that I am attempting to build as 32-bit on a 64-bit system. I have installed the packages required to build 32-bit code, but when I execute the command:
g++ -m32 -o test test.cpp
I get the following error:
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.2.1/libgcc_s.so when searching for -lgcc_s
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
I have tried many permutations of static/shared libraries and manually invoking the linker. when I manually invoke the linker, using a variety of combinations of libraries and crt.o files, it links without error, but when I try to run the program, it says No such file or directory. I suspect that this is because it is trying to load the dynamic libraries it requires and cannot find them, but ldd gives me no insight because it also says No such file or directory, and strace is also useless in this case. I’ve googled this issue, and found others with my problem, but no solution. I’m pretty well stumped on this one, and I’d appreciate any help that may be offered.