交叉编译:armeabigcc-static-o hello.c

交叉编译:armeabigcc-static-o hello.c,arm,embedded-linux,cross-compiling,Arm,Embedded Linux,Cross Compiling,交叉编译(应用程序)“arm eabi gcc-static-o hello hello.c”时出现以下错误 hello.c:1:18: error: stdio.h: No such file or directory hello.c:2:19: error: stdlib.h: No such file or directory hello.c:3:19: error: string.h: No such file or directory hello.c:4:19: error: fcnt

交叉编译(应用程序)“arm eabi gcc-static-o hello hello.c”时出现以下错误

hello.c:1:18: error: stdio.h: No such file or directory
hello.c:2:19: error: stdlib.h: No such file or directory
hello.c:3:19: error: string.h: No such file or directory
hello.c:4:19: error: fcntl.h: No such file or directory
hello.c:5:20: error: unistd.h: No such file or directory
hello.c:6:23: error: sys/types.h: No such file or directory
hello.c:7:22: error: sys/stat.h: No such file or directory
hello.c:8:23: error: sys/ioctl.h: No such file or directory
`
我能够交叉编译内核模块。

您的交叉编译器坏了。要获得更好的工具链,您有很多选择:


如果您试图在linux机器上交叉编译用户程序,则不应使用
arm eabi gcc
,而应使用
arm linux gnueabi gcc

如果这将使用主机编译器(而不是交叉编译器)进行编译,则交叉编译器安装似乎已中断,或者至少没有设置包含路径。另一种可能是源文件有错误,因为您错误地用引号而不是尖括号指定了所有这些系统包含。引号也适用于系统包含文件。我认为交叉编译不会在您的系统路径中找到这些头文件,这对于普通的
gcc
编译器来说。交叉编译器应该有自己的路径maybeYes,arm eabi gcc是一个裸机工具链:它没有libc。因此,C头和库丢失,EnterKEY无法编译用户空间程序。