0

我正在尝试使用 arm gcc 编译器在 Eclipse 中进行交叉编译。我去 projrct ,属性并设置 c/c++ 编译选项并将标志设置为 -mfloat-abi=hard。它在构建时抛出以下异常:

**** Build of configuration Debug for project HelloWorld ****

make all 
Building file: ../src/HelloWorld.c
Invoking: GCC C Compiler
arm-linux-gnueabi-gcc -I/usr/arm-linux-gnueabi/include -O0 -g3 -Wall -mfloat-abi=hard -c -fmessage-length=0 -MMD -MP -MF"src/HelloWorld.d" -MT"src/HelloWorld.d" -o "src/HelloWorld.o" "../src/HelloWorld.c"
Finished building: ../src/HelloWorld.c

Building target: HelloWorld
Invoking: GCC C Linker
arm-linux-gnueabi-gcc -L/usr/arm-linux-gnueabi/lib -mfloat-abi=hard -o "HelloWorld"  ./src/HelloWorld.o   
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: error: ./src/HelloWorld.o uses VFP register arguments, HelloWorld does not
/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: failed to merge target specific data of file ./src/HelloWorld.o
collect2: ld returned 1 exit status
make: *** [HelloWorld] Error 1

**** Build Finished ****

没有那个标志,它构建得很好。但我需要将其设置为在 beaglebone 上运行。任何想法我做错了什么?

使用 -print-multi-lib 后的输出

**** Build of configuration Debug for project HelloWorld ****

make all 
Building file: ../src/HelloWorld.c
Invoking: GCC C Compiler
arm-linux-gnueabi-gcc -I/usr/arm-linux-gnueabi/include -O0 -g3 -Wall -mfloat-abi=hard -c -fmessage-length=0  -print-multi-lib -MMD -MP -MF"src/HelloWorld.d" -MT"src/HelloWorld.d" -o "src/HelloWorld.o" "../src/HelloWorld.c"
arm-linux-gnueabi-gcc: error: ./src/HelloWorld.o: No such file or directory
.;
arm-linux-gnueabi-gcc: fatal error: no input files
compilation terminated.
make: *** [HelloWorld] Error 4
.;@mfloat-abi=softfp
hf;@mfloat-abi=hard
Finished building: ../src/HelloWorld.c

Building target: HelloWorld
Invoking: GCC C Linker
arm-linux-gnueabi-gcc -L/usr/arm-linux-gnueabi/lib -mfloat-abi=hard -o "HelloWorld"  ./src/HelloWorld.o   

**** Build Finished ****
4

0 回答 0