fatal error: gnu/stubs-32.h: No such file

环境:

        

问题:


64bit系统编译32bit程序,遇到问题




# gcc test.c -m32 -o test


/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory  


安装32为的glibc库和头文件

 #yum install glibc-devel.i686




# gcc test.c -m32 -o test


/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: cannot find -lgcc_s



安装gcc的库

 #yum install libgcc.i686


# gcc test.c -m32 -o test


#


ok!


你可能感兴趣的:(fatal error: gnu/stubs-32.h: No such file)