错误“gnu / stubs-32.h:没有这样的文件或目录”同时编译Nachos源代码 [英] Error "gnu/stubs-32.h: No such file or directory" while compiling Nachos source code
问题描述
我试图在笔记本电脑上安装Nachos,笔记本电脑上安装了Ubuntu 11.04。
代码是用C编写的,所以构建它我假设我需要交叉编译器。这是我的问题所在。我使用命令
wget http://mll.csie.ntu.edu下载了MIPS交叉编译器的源代码。 tw / course / os_f08 / assignment / mips-decstation.linux-xgcc.gz
我解压缩它使用
tar zxvf mips-decstation.linux-xgcc.gz
这没关系,但是当我尝试构建nachos os的源代码时,使用make,我得到这个错误 -
/usr/include/gnu/stubs.h:7:27:致命错误:gnu / stubs-32.h:没有这样的文件或目录编译终止。 make:*** [bitmap.o]错误1
我试图按照给出的指示这里 - http://mll.csie.ntu.edu.tw/course /os_f08/217.htm ,除了当我尝试使用make时,一切正常。
重新找回32位libc dev软件包:
在 Ubuntu 上,它叫做libc6-dev-i386 - do sudo apt - 请安装libc6-dev-i386
。请参阅下面的Ubuntu 12.04的额外说明。
在Red Hat发行版中,软件包名称为 glibc-devel。 i686
(感谢David Gardner的评论)
在 CentOS 5.8 上,包名是 glibc-devel.i386
(感谢JimKleck的评论)
在 CentOS 6/7 是 glibc-devel.i686
。
$ b 在 SLES 上,它被称为glibc-devel- 32bit - 做
zypper in glibc-devel-32bit
你使用 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)
$ b $如果你也在编译C ++代码,那么你可以在编译C ++代码之前,先在你的.bashrc文件中找到它。 你还需要32位的stdc ++库。如果您看到以下警告:
.... / usr / bin / ld:找不到-lstdc ++ ....
在 Ubuntu 上,您需要执行 sudo apt-get install g ++ - multilib code>
在 CentOS 5 上,您需要执行 在 CentOS 6 中,您需要执行 请随时在其他系统的软件包中编辑。 I am trying to install Nachos on my laptop and I have Ubuntu 11.04 on the laptop. The code is in C and so to build it I assume I will need cross compiler. This is where my problem is. I downloaded the source code of the MIPS cross compiler using the command and I unzipped it using This is okay, but when I try to build the source code of the nachos os, using make, I get this error - I am trying to follow the instructions given over here - http://mll.csie.ntu.edu.tw/course/os_f08/217.htm and everything is working fine except when I try to use make. You're missing the 32 bit libc dev package: On Ubuntu it's called libc6-dev-i386 - do On Red Hat distros, the package name is On CentOS 5.8, the package name is On CentOS 6 / 7, the package name is On SLES it's called glibc-devel-32bit - do Are you using Ubuntu 12.04? There is a known problem that puts the files in a non standard location. You'll also need to do: somewhere before you build (say in your .bashrc). If you are also compiling C++ code, you will also need the 32 bit stdc++ library. If you see this warning: .... /usr/bin/ld: cannot find -lstdc++ .... On Ubuntu you will need to do On CentOS 5 you will need to do On CentOS 6 you will need to do Please feel free to edit in the packages for other systems. 这篇关于错误“gnu / stubs-32.h:没有这样的文件或目录”同时编译Nachos源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! yum install libstdc ++ - devel.i386 code
yum install libstdc ++ - devel.i686 code>
wget http://mll.csie.ntu.edu.tw/course/os_f08/assignment/mips-decstation.linux-xgcc.gz
tar zxvf mips-decstation.linux-xgcc.gz
/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
sudo apt-get install libc6-dev-i386
. See below for extra instructions for Ubuntu 12.04.glibc-devel.i686
(Thanks to David Gardner's comment)glibc-devel.i386
(Thanks to JimKleck's comment)glibc-devel.i686
.zypper in glibc-devel-32bit
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)
sudo apt-get install g++-multilib
yum install libstdc++-devel.i386
yum install libstdc++-devel.i686