centos gnu/stubs-32.h:没有那个文件或目录

在Centos64位机器上,使用“gcc -m32”编译32位程序时,提示如下错误:
在包含自 /usr/include/features.h:385 的文件中,
                 从 /usr/include/stdio.h:28,
                 从 lex.yy.cpp:20:
/usr/include/gnu/stubs.h:7:27: 错误:gnu/stubs-32.h:没有那个文件或目录
make: *** [lex.yy.32.g.o] Error 1

You need to install the glibc-devel package. It contains the object files necessary for developing programs which use the standard C libraries (which are used by nearly all programs). If you are developing programs which will use the standard C libraries, your system needs to have these standard object files available in order to create the executables.

根据如上对错误原因的描述,我们只需按照对应系统类型,使用不同的方法安装“glibc-devel”包即可。
针对centos而言:
Fix for the RHEL/CentOS 5.x for GCC gnu/stub-32.h missing error

Type the following yum command:
# yum -y install glibc-devel.i386

Fix for the RHEL/CentOS 6.x for GCC gnu/stub-32.h missing error

Type the following yum command:
# yum -y install glibc-devel.i686 glibc-devel

yum -y install glibc-devel.i686 glibc-devel

参考:http://www.cyberciti.biz/faq/x86_64-linux-error-gnustub-32h-missing-error-and-solution/
posted @ 2009-11-14 22:35  酱油和醋  阅读(2433)  评论(0编辑  收藏  举报