我使用Ubuntu 15.10 64位。 gcc-5-multilib,g ++ - 5-multilib,libc6-i386,內核頭文件和所有構建工具鏈都已安裝。當我嘗試編譯32位庫(Linux)的,如:sys/socket.h嘗試在64位Linux平臺上編譯32位庫的致命錯誤
gcc -m32 -fPIC -shared -Wl,-soname,mylib.so -o mylib.so mylib.c
我得到一個錯誤:
/usr/include/bits/socket.h:345:24: fatal error: asm/socket.h: No such file or directory
我能做些什麼來編譯在64位的32位Linux與#include <sys/socket.h>
代碼?
看到這個評論:http://stackoverflow.com/questions/16496635/fatal-error-sys-socket-h-no-such-file-or-directory- on-32bit?rq = 1#comment23677965_16496635 – alk
另請參閱此答案:http://stackoverflow.com/a/1272420/694576 – alk
[THIS](http://unix.stackexchange.com/a/208594)可能會幫助 – LPs