我正在使用arm-none-eabi (Debian的包)头来编译一个包含ARM (特别是Cortex-M3)的arm-none-eabi文件。该命令是:
clang -I/usr/lib/gcc/arm-none-eabi/4.8/include \
-target arm-none-eabi cfile.c -o cfile.o(为了简单起见,-mcpu,-mfpu,-mfloat-abi都被忽略了)
返回一个错误:
In file included from cfile.c:1:
In file included from ./cfile.h:4:
In file included from /usr/lib/gcc/arm-none-eabi/4.8/include/stdint.h:9:
In file included from /usr/lib/llvm-3.5/bin/../lib/clang/3.5.0/include/stdint.h:61:
In file included from /usr/include/stdint.h:25:
/usr/include/features.h:374:12: fatal error: 'sys/cdefs.h' file not found
# include <sys/cdefs.h>
^
1 error generated.我一直在跟踪本指南。
我的版本:
$ clang --version
Debian clang version 3.5.0-10 (tags/RELEASE_350/final) (based on LLVM 3.5.0)
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (4.8.4-1+11-1) 4.8.4 20141219 (release)对如何解决这个问题有什么想法吗?
P.S.:不是这个问题的复制品。
发布于 2016-02-09 15:55:06
要解决这个问题,您必须安装g++-multilib
g++-multilib - GNU C++编译器,这是一个可移植的C++优化编译器。它将安装所需的标头。
作为sysroot选项的回答(来自注释部分):您绝对正确,sysroot应该与从zip安装的交叉编译器一起使用。从您正在尝试使用的编译器的问题来看,还不清楚。
https://stackoverflow.com/questions/35295502
复制相似问题