ubuntu - 构建 Jonesforth - asm/unistd.h:没有这样的文件或目录
问题描述
尝试在 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
查看文件jonesforth.S
,我注意到以下几行:
//#include <asm-i386/unistd.h> // You might need this instead
#include <asm/unistd.h>
我尝试过使用asm-i386/unistd.h
,但这似乎也没有帮助。
是通过安装更多标头的最佳做法sudo apt install linux-headers...
吗?如果是这样,我应该选择哪个?应该linux-headers-generic
够了吧?
或者,我应该更改jonesforth.S
所指的标题吗?
解决方案
添加-I /usr/include/x86_64-linux-gnu
到 make recipe 似乎已经解决了这个问题:
jonesforth: jonesforth.S
gcc -I /usr/include/x86_64-linux-gnu -m32 -nostdlib -static $(BUILD_ID_NONE) -o $@ $<
感谢上面Peter Cordes的建议!
推荐阅读
- bash - 带有变量的 printf 没有按预期工作
- dart - 如何在颤动中更改日期和时间格式?
- sql - SQL:PostgresSQL,按两列分组和平均 - 即使平均值为零,如何显示所有组
- r - 计算具有多个变量的两个不同列的总和和频率,并使用面积图进行绘图
- swift - 如何使在 macOS 上运行的应用程序浮动在其他应用程序之上?
- apache-kafka - kafka 消费者组 ID 无法按预期工作
- javascript - 为什么我的代码显示“找不到播放器”?
- c# - 试图创建简单的 js 缩小器,但它不会删除任何东西,即使我删除了空格
- vue.js - 当按钮已经被点击时,如何禁用按钮取决于它的行?
- file - 如何使用 make 保持文件同步?