交叉编译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下一个回答

转载于:https://www.cnblogs.com/Jacket-K/p/7341158.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值