构建 Jonesforth - asm/unistd.h:没有这样的文件或目录 [英] Building Jonesforth - asm/unistd.h: No such file or directory
问题描述
尝试在 Ubuntu 16.04.4 上构建 Jonesforth(32 位 GNU 汇编程序)时64 位(Xenial Xerus),我看到以下内容:
When attempting to build Jonesforth (32-bit GNU Assembler program) on Ubuntu 16.04.4 64-bit (Xenial Xerus), I'm seeing the following:
~/src/jonesforth $ make
gcc -m32 -nostdlib -static -o jonesforth jonesforth.S
jonesforth.S:1154:24: fatal error: asm/unistd.h: No such file or directory
compilation terminated.
Makefile:11: recipe for target 'jonesforth' failed
查看文件 jonesforth.S
,我注意到以下几行:
Looking in the file jonesforth.S
, I noticed the following lines:
//#include <asm-i386/unistd.h> // You might need this instead
#include <asm/unistd.h>
我尝试使用 asm-i386/unistd.h
代替,但这似乎也没有帮助.
I've tried using asm-i386/unistd.h
instead, but that also didn't seem to help.
是通过 sudo apt install linux-headers...
安装更多头文件的最佳做法吗?如果是这样,我应该和哪个一起去?linux-headers-generic
就足够了吗?
Is the best course of action to install more headers via sudo apt install linux-headers...
? If so, which should I go with? Should linux-headers-generic
be sufficient?
或者,我应该更改 jonesforth.S
所指的标题吗?
Or, should I change the header that jonesforth.S
is referring to?
推荐答案
将 -I/usr/include/x86_64-linux-gnu
添加到 make recipe 似乎解决了这个问题:>
Adding -I /usr/include/x86_64-linux-gnu
to the make recipe seems to have solved the issue:
jonesforth: jonesforth.S
gcc -I /usr/include/x86_64-linux-gnu -m32 -nostdlib -static $(BUILD_ID_NONE) -o $@ $<
感谢上面 Peter Cordes 的建议!
这篇关于构建 Jonesforth - asm/unistd.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!