我想在Ubuntu-14.04上编译一个适用于Android设备的gdbserver,所以我安装了交叉编译工具
apt-get install gcc-arm-linux-androideabi
gdb 的配置脚本选项是 --target=arm-linux-androideabi
,
gdbserver 的选项是 --host=arm-linux-androideabi --target=arm-linux-androideabi
但是当我开始使用 make
编译 gdbserver 时,出现错误:
arm-linux-androideabi-gcc -g -O2 -I. -I. -I./../common -I./../regformats -I./../../include -I./../gnulib/import -Ibuild-gnulib-gdbserver/import -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-char-subscripts -Wempty-body -Werror -DGDBSERVER -c -o linux-osdata.o -MT linux-osdata.o -MMD -MP -MF .deps/linux-osdata.Tpo ../common/linux-osdata.c ../common/linux-osdata.c:1055:1: error: conflicting types for 'group_from_gid' In file included from ../common/linux-osdata.c:37:0: /usr/lib/gcc/arm-linux-androideabi/4.7.3/../../../../arm-linux-androideabi/include/grp.h:72:8: note: previous declaration of 'group_from_gid' was here make: *** [linux-osdata.o] Error 1
我该如何解决这个问题? 谢谢。
最佳答案
我刚刚得到了这样的解决方法:
将 arm-linux-androideabi
替换为 arm-linux-gnueabi
并使其静态链接。
关于linux - 交叉编译错误: previous declaration of 'group_from_gid' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29643646/