linux - 交叉编译错误: previous declaration of 'group_from_gid'

标签 linux android-ndk

我想在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/

相关文章:

Linux:超时基于 CPU 时间

linux - Grep 使用帮助

linux - 如何使用 Bash 使用另一个文本文件中存在的转换来替换文本文件列中的名称

linux - Ngrep 多个 pcaps

c++ - Android OpenSL ES 在初始化时崩溃

Android NDK memcpy 崩溃,在 libc.so 中带有 proguard 的断回跟踪

java - 在 Linux 上的 java 中针对远程 Activity 目录的身份验证

Android 在特定设备上崩溃 - 由 int64 分配引起

Android 无法解析类型 ulong64

android - ndk-build找不到jni目录下的文件