![]() |
Compiling 32 bit sample program on 64 bit fedora using -m32 option
I have Fedoara 11 install on my PC. I want to compile program as 32 by g++ option -m32. I have 32 bit library install on my machine which present in path
/usr/lib/gcc/x86_64-linux-gnu/4.4.0/32 and 64 bit library is on path /usr/lib/gcc/x86_64-linux-gnu/4.4.0 When i compile my sample program with -c & -m32 option it compile correctly c++ -c -m32 Sample.cpp but when i am trying to create executable by command c++ Sample.o -m32 -o Sample then it gives linking error as /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.0/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.0/libstdc++.a when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.0/libstdc++.so when searching for -lstdc++ /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.0/libstdc++.a when searching for -lstdc++ /usr/bin/ld: cannot find -lstdc++ collect2: ld returned 1 exit status Can anybody please tell me solution for this problem |
You have to explicitly tell the linker to use the libstdc++ in /usr/lib/gcc/x86_64-linux-gnu/4.4.0/32.
|
How can i explicitly tell linker. I have set that path in LD_LIBRARY_PATH as well as i have given it in -L option while compiling it still it gives same error.
|
| All times are GMT -5. The time now is 05:28 PM. |