简体   繁体   English

建筑物Jonesforth-asm / unistd.h:无此类文件或目录

[英]Building Jonesforth - asm/unistd.h: No such file or directory

When attempting to build Jonesforth (32-bit GNU Assembler program) on Ubuntu 16.04.4 64-bit (Xenial Xerus), I'm seeing the following: 尝试在Ubuntu 16.04.4 64位(Xenial Xerus)上构建Jonesforth (32位GNU汇编程序)时,我看到以下内容:

~/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

Looking in the file jonesforth.S , I noticed the following lines: 在文件jonesforth.S ,我注意到以下几行:

//#include <asm-i386/unistd.h>  // You might need this instead
#include <asm/unistd.h>

I've tried using asm-i386/unistd.h instead, but that also didn't seem to help. 我尝试使用asm-i386/unistd.h代替,但这似乎也无济于事。

Is the best course of action to install more headers via sudo apt install linux-headers... ? 通过sudo apt install linux-headers...安装更多头文件的最佳做法是吗? If so, which should I go with? 如果是这样,我应该选择哪一个? Should linux-headers-generic be sufficient? linux-headers-generic应该足够吗?

Or, should I change the header that jonesforth.S is referring to? 还是应该更改jonesforth.S所指的标头?

Adding -I /usr/include/x86_64-linux-gnu to the make recipe seems to have solved the issue: -I /usr/include/x86_64-linux-gnu到make配方中似乎已经解决了该问题:

jonesforth: jonesforth.S
        gcc -I /usr/include/x86_64-linux-gnu -m32 -nostdlib -static $(BUILD_ID_NONE) -o $@ $<

Thanks to the suggestion from Peter Cordes above! 感谢上面的Peter Cordes的建议!

您需要安装软件包multilib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM