main.o: could not read symbols: File in wrong format

来源:百度文库 编辑:神马文学网 时间:2024/03/29 10:39:56
haliiz@haliiz-desktop:~/gps$ make
/usr/local/arm/4.3.2/bin/arm-linux-gcc  -o gps main.o gps.o
/usr/local/arm/4.3.2/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.2/../../../../arm-none-linux-gnueabi/bin/ld: main.o: Relocations in generic ELF (EM: 3)
main.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [gps] 错误 1
haliiz@haliiz-desktop:~/gps$ make clean
rm -f gps *.o
haliiz@haliiz-desktop:~/gps$ make
/usr/local/arm/4.3.2/bin/arm-linux-gcc     -c -o main.o main.c
/usr/local/arm/4.3.2/bin/arm-linux-gcc     -c -o gps.o gps.c
/usr/local/arm/4.3.2/bin/arm-linux-gcc  -o gps main.o gps.o
haliiz@haliiz-desktop:~/gps$ ls
gps  gps.c  gps.h  gps.o  main.c  main.o  makefile  makefile01  makefile02
用make clean 就好了.
原因可能是在当前目录下有旧的文件。本次编译的时候由于硬件平台不同。格式认不出来了。