/usr/bin/ld: .libs/dev2gif.o: Relocations in generic ELF (EM: 40)

bingyunjunqing 2012-07-12 09:57:53
我用arm-none-linux-gnueabi-gcc做交叉编译器,可总是编译不过去,错误提示如下:

gcc -shared .libs/dev2gif.o .libs/dgif_lib.o .libs/egif_lib.o .libs/gif_err.o .libs/gif_font.o .libs/gif_hash.o .libs/gifalloc.o .libs/qprintf.o .libs/quantize.o -Wl,-soname -Wl,libgif.so.4 -o .libs/libgif.so.4.1.6
/usr/bin/ld: .libs/dev2gif.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/dev2gif.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/dev2gif.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/dev2gif.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/dev2gif.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: .libs/dev2gif.o: Relocations in generic ELF (EM: 40)
.libs/dev2gif.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[2]: *** [libgif.la] Error 1
make[2]: Leaving directory `/home/ema/lzq/giflib-qq4.1.6/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ema/lzq/giflib-qq4.1.6'
make: *** [all] Error 2


我试了很多方法,总是不成功,希望详解,谢谢~ ~ ~
...全文
1141 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
jshonwang 2013-09-13
  • 打赏
  • 举报
回复
我用的是jepg9,至于6b不知道,这个问题我也遇到了: CCLD libjpeg.la /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=/home/wangqi/lib-jpeg/ --exec-prefix=/home/wangqi/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了,就可以通过编译
Rex8912 2012-07-19
  • 打赏
  • 举报
回复
那就试一下下面的方法吧:
./configure --host=你要运行程序的主机 CC=你用到的交叉编译链

18,787

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧