linux64下编译32位程序
gcc -o xxx -m32 xxx.c
遇到问题
/usr/include/gnu/stubs.h:7:27: 致命错误:gnu/stubs-32.h:没有那个文件或目录
安装glibc-devel.i686、libstdc++-devel.i686
yum install glibc-devel.i686 libstdc++-devel.i686
还有可能的问题
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.7/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: skipping incompatible /lib/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
安装libgcc.i686,
yum -y install libgcc.i686
如果yum上的版本编号和本地已安装64位的编号不同,可升级本地版本再