Linux /usr/include/gnu/stubs.h:7:27: 错误: gnu/stubs-32.h: 没有那个文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10225944/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 05:52:35  来源:igfitidea点击:

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

linuxgnui386

提问by user2931

I am trying to install roccc 2.0. I have installed required packages. Now while installing it, it is giving me this error:

我正在尝试安装roccc 2.0. 我已经安装了所需的软件包。现在在安装它时,它给了我这个错误:

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

I searched for gnu/stubs-32.hand came to know, for Linux 64-bit its in glibc-develand for Linux 32-bit, its in libc6-dev-i386.

我搜索gnu/stubs-32.h并了解到,对于 Linux 64 位,其 inglibc-devel和对于 Linux 32 位,其 in libc6-dev-i386.

I am using Linux 32-bit: i386 GNU/Linux, but couldn't get the librequired to resolve this error.

我正在使用 Linux 32 位:i386 GNU/Linux,但无法获得lib解决此错误所需的条件。

Can somebody please help me out?

有人可以帮我吗?

回答by Oleksandr Kravchuk

Install 'glibc-devel' package, or whatever it called in your distro. You may also need to install ia32-libs lib32z1-dev lib32bz2-dev (names could be different in your distro).

安装“glibc-devel”包,或者它在你的发行版中调用的任何东西。您可能还需要安装 ia32-libs lib32z1-dev lib32bz2-dev(名称在您的发行版中可能不同)。

回答by gfour

Header file gnu/stubs-32.his under /usr/include/i386-linux-gnu/but the install script tries to find it in /usr/include/, try this quick fix to complete the installation:

头文件gnu/stubs-32.h在下,/usr/include/i386-linux-gnu/但安装脚本试图在/usr/include/.

sudo ln -s /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu/stubs-32.h

sudo ln -s /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu/stubs-32.h

After installation is finished, you can delete the link.

安装完成后,您可以删除链接。

回答by Subba Reddy

If your Linux distro is Redhat based (Fedora/CentOS/RHEL):

如果您的 Linux 发行版基于 Redhat (Fedora/CentOS/RHEL):

yum install glibc-devel.i686

References

参考

回答by Aman

The script is trying to get stubs-32.h from /usr/include/ where it is not found. To solve this you have to add an "include" path (by default it is /usr/include) like this:

该脚本试图从 /usr/include/ 中未找到它的地方获取 stubs-32.h。要解决这个问题,您必须添加一个“包含”路径(默认情况下为/usr/include),如下所示:

C_INCLUDE_PATH=/usr/include/i386-linux-gnu/
export C_INCLUDE_PATH

OR

或者

export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)

You can visit Error "gnu/stubs-32.h: No such file or directory" while compiling Nachos source codefor additional reference.

您可以在编译 Nachos 源代码时访问Error "gnu/stubs-32.h: No such file or directory"以获取更多参考。

回答by amarnath chatterjee

The package name keeps on changing, just do a

包名不断变化,只需做一个

yum list glibc-devel

to find out current package for 32 bit. In my case it only listed 2 packages one for 32 bit and one for 64 bit. I just installed the 32 bit using

找出 32 位的当前包。就我而言,它只列出了 2 个包,一个用于 32 位,一个用于 64 位。我刚刚安装了 32 位使用

yum install glibc-devel.i686

回答by slm

If on a Red Hat distro such as Fedora/CentOS/RHEL you can do the following to find out what package provides a given file:

如果在 Red Hat 发行版(例如 Fedora/CentOS/RHEL)上,您可以执行以下操作以找出提供给定文件的软件包:

$ repoquery -qf */stubs-32.h
glibc-devel-0:2.17-260.el7.i686

And then install it:

然后安装它:

$ sudo yum install -y glibc-devel-0:2.17-260.el7.i686