交叉编译jpeglib遇到的问题

时间:2023-03-09 05:40:00
交叉编译jpeglib遇到的问题

由于要在开发板中加载libjpeg,不能使用gcc编译的库文件给以使用,需要自己配置使用另外的编译器编译该库文件。

/usr/bin/ld: .libs/jaricom.o: Relocations in generic ELF (EM: 40) 
/usr/bin/ld: .libs/jaricom.o: Relocations in generic ELF (EM: 40) 
.libs/jaricom.o: could not read symbols: File in wrong format 
collect2: ld returned 1 exit status 
make[1]: *** [libjpeg.la] Error 1 
make[1]: Leaving directory `/home/wangqi/jpeg-9' 
make: *** [all] Error 2 
解决办法是./configure 的时候要配置好: 
./configure CC=arm-fsl-linux-gnueabi-gcc LD=arm-fsl-linux-gnueabi-ld --prefix=~/lib-jpeg/ --exec-prefix=~/lib-jpeg/ --enable-shared --enable-static --host=arm-fsl-linux-gnueabi 
CC是编译器 
LD要配置 
--host最好设成CC和LD中除了-gcc和-ld的前面部分,如arm-fsl-linux-gnueabi,因为生产的makefile中就可以自动添加arm-fsl-linux-gnueabi-ramlib之类的,省去自己手头设置。 
最后make的时候就不是用/usr/bin/ld了,就可以通过编译。

转载自http://www.itnose.net/detail/930743.html下一个回答