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

*爱你&永不变心* 提交于 2020-01-09 23:42:04
在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/
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!