ubuntu 下交叉编译cgic205

本文档详细介绍了如何在Ubuntu系统中,针对ARM架构进行CGIC库的交叉编译。首先,通过解压源码包cgic205.tar.gz开始。接着,进入源码目录并修改Makefile,将所有gcc替换为arm-linux-gcc以适应ARM平台。编译过程中可能会遇到错误,如‘Relocations in generic ELF (EM: 40)’,这通常是因为编译器配置不正确导致。最后,执行make命令完成编译过程。
摘要由CSDN通过智能技术生成

1:解压

   tar zxvf   cgic205.tar.gz

2:修改编译器

   cd cgic205

   修改如下:



注意:要将所有的gcc的地方改成arm-linux-gcc ,不然容易出现以下的错误提示


arm-linux-gcc -g -Wall   -c -o cgic.o cgic.c
rm -f libcgic.a
arm-linux-ar rc libcgic.a cgic.o
arm-linux-ranlib libcgic.a
arm-linux-gcc -g -Wall   -c -o cgictest.o cgictest.c
gcc cgictest.o -o cgictest.cgi -L./ -lcgic
/usr/bin/ld: cgictest.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: cgictest.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: cgictest.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: cgictest.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: cgictest.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: cgictest.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: cgictest.o: Relocations in generic ELF (EM: 40)
cgictest.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [cgictest.cgi] 错误 1

3:make  

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值