nachos交叉编译器java_ubuntu - 编译Nachos源代码时出错“gnu / stubs-32.h:没有这样的文件或目录”...

ubuntu - 编译Nachos源代码时出错“gnu / stubs-32.h:没有这样的文件或目录”

我想在我的笔记本电脑上安装Nachos,笔记本电脑上有Ubuntu 11.04。

代码在C中,所以要构建它我假设我需要交叉编译器。 这就是我的问题所在。 我使用命令下载了MIPS交叉编译器的源代码

wget http://mll.csie.ntu.edu.tw/course/os_f08/assignment/mips-decstation.linux-xgcc.gz

我用它解压缩它

tar zxvf mips-decstation.linux-xgcc.gz

这没关系,但是当我尝试构建nachos操作系统的源代码时,使用make,我得到了这个错误 -

/usr/include/gnu/stubs.h:7:27: fatal error: gnu/stubs-32.h: No such file or directory compilation terminated. make: *** [bitmap.o] Error 1

我试图按照这里给出的指示 - [http://mll.csie.ntu.edu.tw/course/os_f08/217.htm]并且一切正常,除非我尝试使用make。

10个解决方案

313 votes

你错过了32位libc dev包:

在Ubuntu上它叫做libc6-dev-i386 - 做yum install libstdc++-devel.i686.有关Ubuntu 12.04的额外说明,请参见下文。

在Red Hat发行版中,软件包名称为yum install libstdc++-devel.i686(感谢David Gardner的评论)

在CentOS 5.8上,软件包名称为yum install libstdc++-devel.i686(感谢JimKleck的评论)

在CentOS 6/7上,软件包名称为yum install libstdc++-devel.i686。

在SLES上它被称为glibc-devel-32bit - 做yum install libstdc++-devel.i686

在Gentoo上它被称为yum install libstdc++-devel.i686 - 做emerge -1a sys-libs/gcc[来源](注:一个人可以用equery确认这是正确的;做equery belongs belongs /usr/include/gnu/stubs-32.h)

你在使用Ubuntu 12.04吗? 存在将文件置于非标准位置的已知问题。 你还需要这样做:

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)

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

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

在构建之前的某个地方(比如你的.bashrc)。

如果您还在编译C ++代码,那么您还需要32位stdc ++库。 如果您看到此警告:

.... / usr / bin / ld:找不到-lstdc ++ ....

在Ubuntu上你需要做yum install libstdc++-devel.i686

在CentOS 5上,你需要做yum install libstdc++-devel.i686

在CentOS 6上,你需要做yum install libstdc++-devel.i686

请随意在其他系统的软件包中进行编辑。

Timothy Jones answered 2019-05-09T16:41:08Z

51 votes

来自GNU UPC网站:

编译器构建失败并出现致命错误:gnu / stubs-32.h:没有这样的文件或   目录

此错误消息显示在GCC / UPC的64位系统上   multilib功能已启用,它表示32位版本   没有安装libc。 有两种方法可以解决此问题:

安装32位版本的glibc(例如Fedora上的glibc-devel.i686,   CentOS,..)

通过提供“--disable-multilib”禁用“multilib”构建   打开编译器配置命令

ignis answered 2019-05-09T16:42:03Z

10 votes

试试做apt-file。

apt-file告诉我有问题的文件属于该软件包。

Keith Layne answered 2019-05-09T16:42:35Z

7 votes

现在在GCC维基常见问题中,请参阅[http://gcc.gnu.org/wiki/FAQ#gnu_stubs-32.h]

Jonathan Wakely answered 2019-05-09T16:43:01Z

1 votes

嗯,我在ubuntu 12.04上,在尝试编译gcc 4.7.2时遇到了同样的错误

我尝试安装stubs-32.h软件包并获得以下信息:

Package libc6-dev-i386 is not available, but is referred to by another package.

This may mean that the package is missing, has been obsoleted, or

is only available from another source

E: Package 'libc6-dev-i386' has no installation candidate

我还在bash中设置了正确的环境变量:

export LIBRARY_PATH=/usr/lib/$(gcc -print-multiarch)

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

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

然而,我仍然得到错误然后我只是复制stubs-32.h到gcc在做快速差异后期望找到它的地方:

vic@ubuntu:/usr/include/i386-linux-gnu/gnu$ diff ../../gnu ./

Only in ./: stubs-32.h

Only in ../../gnu: stubs-64.h

vic@ubuntu:/usr/include/i386-linux-gnu/gnu$ sudo cp stubs-32.h ../../gnu/

[sudo] password for vic:

vic@ubuntu:/usr/include/i386-linux-gnu/gnu$ diff ../../gnu ./

Only in ../../gnu: stubs-64.h

vic@ubuntu:/usr/include/i386-linux-gnu/gnu$

它正在编译,让我们看看它是否抱怨更多......

Victor Parmar answered 2019-05-09T16:43:55Z

1 votes

我在fedora 18盒子上遇到以下错误:

1。/usr/include/gnu/stubs.h:7:27:致命错误:gnu / stubs-32.h:没有这样的文件或目录编译终止。

我安装了glibc.i686和glibc-devel.i686,然后编译失败并出现以下错误:

2。/ usr / bin / ld:在搜索-lgcc_s时跳过不兼容的/usr/lib/gcc/x86_64-redhat-linux/4.7.2/libgcc_s.so/ usr / bin / ld:找不到-lgcc_scollect2:错误:ld返回1退出状态

解:

我安装了(yum install)glibc.i686 glibc-devel.i386和libgcc.i686来摆脱编译问题。

现在编译32位(-m32)工作正常。

user2223366 answered 2019-05-09T16:45:03Z

0 votes

FWIW,在交叉编译时使用来自/ usr / include的文件时,它闻起来像是一个错误(或至少是未来痛苦的潜在来源)。

user47559 answered 2019-05-09T16:45:29Z

0 votes

gnu/stubs-32.h未直接包含在程序中。 它是gnu/stubs.h的后端类型头文件,就像gnu/stubs-64.h一样。您可以安装multilib软件包来添加它们。

user2775212 answered 2019-05-09T16:45:58Z

0 votes

#sudo apt-get install g ++ - multilib

应该在64位计算机(Debian / Ubuntu)上修复此错误。

skrishnakar answered 2019-05-09T16:46:36Z

0 votes

如果您在使用python的Mac-OSX终端中遇到此问题,请尝试更新您正在使用的软件包的版本。 因此,转到python中的文件以及指定软件包的位置,将它们更新为Internet上提供的最新版本。

D.Bhatia answered 2019-05-09T16:47:04Z

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值