我正在使用用于 arm (arm-none-linux-gnueabi) 的 CodeSourcery 工具链进行交叉编译。我使用 -isysroot 指向/usr/include
rootfs 文件夹上的文件夹,但在编译时遇到了麻烦。我已经验证了包含文件夹是可访问的。
下面是 gcc 调用和输出。一些输出被删除,因为我认为它不相关。
预处理器提出了一个正确的包含路径,除了它以“=”字符开头,并指示该路径不存在。然后它无法找到头文件。
我怎样才能使这项工作?
willem@jacta:~/Projects/button/Debug$ arm-none-linux-gnueabi-gcc -isysroot=/home/willem/Projects/rootfs -nostdinc -I=/usr/include -O0 -g3 -Wall -c -fmessage-length=0 -v -o src/smd/button/button.o ../src/smd/button/button.c -H
Using built-in specs.
Target: arm-none-linux-gnueabi
Configured with: [ ... stuff omitted ... ]
Thread model: posix
gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202)
COLLECT_GCC_OPTIONS='-isysroot=/home/willem/Projects/rootfs' '-nostdinc' '-I' '=/usr/include' '-O0' '-g3' '-Wall' '-c' '-fmessage-length=0' '-v' '-o' 'src/smd/button/button.o' '-H' '-march=armv5te' '-funwind-tables'
/home/willem/Tools/CodeSourcery/Sourcery_G++_Lite/bin/../libexec/gcc/arm-none-linux-gnueabi/4.4.1/cc1 -quiet -nostdinc -v -I =/usr/include -iprefix /home/willem/Tools/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/ -isysroot /home/willem/Tools/CodeSourcery/Sourcery_G++_Lite/bin/../arm-none-linux-gnueabi/libc -dD -H -isysroot=/home/willem/Projects/rootfs ../src/smd/button/button.c -quiet -dumpbase button.c -march=armv5te -auxbase-strip src/smd/button/button.o -g3 -O0 -Wall -version -fmessage-length=0 -funwind-tables -o /tmp/ccWnd3Xk.s
ignoring nonexistent directory "=/home/willem/Projects/rootfs/usr/include"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
GNU C (Sourcery G++ Lite 2010q1-202) version 4.4.1 (arm-none-linux-gnueabi)
compiled by GNU C version 4.3.2, GMP version 4.3.1, MPFR version 2.4.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 250bf78701f747da89e730786c466148
. ../src/smd/button/button.h
../src/smd/button/button.c:2: error: no include path in which to search for pthread.h
[ ... etc. ... ]
谢谢!
W