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

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





