asm/errno.h:没有这样的文件或目录

mah*_*ood 35 linux gcc

在构建gcc时,我收到此错误:

In file included from /usr/include/bits/errno.h:25,
             from /usr/include/errno.h:36,
             from ../.././gcc/tsystem.h:96,
             from ../.././gcc/crtstuff.c:68:
/usr/include/linux/errno.h:4:23: error: asm/errno.h: No such file or directory
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `/opt/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc'
Run Code Online (Sandbox Code Playgroud)

我从源代码构建gcc 4.1.我想我必须安装build-essential.但是在ubuntu 12.04中安装该软件包将自动下载并安装gcc 4.6,我不希望这样.

还有其他方法吗?

jrr*_*jrr 39

我想你想要的包装是linux-libc-dev.我在建造32-on-64时遇到过这种情况; 所以我需要linux-libc-dev:i386.


小智 32

这对我有用:

ln -s /usr/include/asm-generic /usr/include/asm
Run Code Online (Sandbox Code Playgroud)

  • 实际上,它看起来类似于你所做的`apt-get install gcc-multilib`(`apt-file search/usr/include/asm`显示这个包)和我的系统上安装了,`//usr/include/asm`是一个符号链接.不知道这个包是否依赖于`build-essential`. (3认同)

nki*_*gen 20

这对我有用:

sudo ln -s /usr/include/asm-generic /usr/include/asm
Run Code Online (Sandbox Code Playgroud)

原因是GCC希望被调用的/usr/include/asm内容/usr/include/asm-generic在某些发行版中被重命名.


New*_*yte 11

即使我使用基于 LLVM 的编译器进行编译,这也为我在 Debian 10 上解决了这个问题:

sudo apt install gcc-multilib
Run Code Online (Sandbox Code Playgroud)


小智 5

这为我修好了。

sudo apt-get install linux-libc-dev:i386
Run Code Online (Sandbox Code Playgroud)


Dav*_*ave 3

/usr/include/asm/errno.h是 linux 头文件的一部分。我不能直接谈论 Ubuntu 12.04,但一般来说,您可以将 Linux 源代码下载为您的发行版的软件包,并且不需要您下载/安装 gcc。如果失败,您可以手动下载适合您的内核版本的 linux 标头(uname -a ),并使用 CFLAGS 的 include 指令来指定要查找这些标头的目录。

编辑:sudo apt-get install linux-headers-generic可能适合你。