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?
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!
您需要安装软件包multilib
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.