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

前提是你 提交于 2020-07-09 03:23:12

问题


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

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>

I've tried using asm-i386/unistd.h instead, but that also didn't seem to help.

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?

Or, should I change the header that jonesforth.S is referring to?


回答1:


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 $@ $<

Thanks to the suggestion from Peter Cordes above!




回答2:


You need to install package multilib.



来源:https://stackoverflow.com/questions/53685776/building-jonesforth-asm-unistd-h-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!