一、问题描述
在嵌入式linux开发中,进行交叉编译,报错如下
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
ld: src/PS_Packet_Packaging.o: Relocations in generic ELF (EM: 40)
src/PS_Packet_Packaging.o: error adding symbols: File in wrong format
Makefile:52: recipe for target 'libStreamParse.so' failed
make: *** [libStreamParse.so] Error 1
二、问题分析
检查CC、CXX、LD相关的参数的配置,.o文件或交叉编译工具有问题
三、解决方案
个人此处是由于LD参数未给造成的。编译如下
make CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld