首页 > 解决方案 > 尝试为 android arm64 交叉编译 libnl 时出错

问题描述

我以前使用我的独立 aarch64-linux-android 工具链为我的 android 手机交叉编译项目。

在尝试交叉编译 libnl(3.2.25 和旧版本)时,我在制作时不断收到此错误 -

CCLD     nf-ct-list
../src/lib/.libs/libnl-cli-3.so: undefined reference to `getsubopt'
collect2: error: ld returned 1 exit status

我的设置环境 -

#!/bin/bash
# Add the standalone toolchain to the search path.
export PATH=$PATH:/home/john/toolchain-gcc/bin

# Tell configure what tools to use.
target_host=aarch64-linux-android
export AR=$target_host-ar
#export AS=$target_host-gcc
export CC=$target_host-gcc
export CXX=$target_host-g++
export LD=$target_host-ld
export STRIP=$target_host-strip

# Tell configure what flags Android requires.
export CFLAGS="-fPIE -fPIC"
export LDFLAGS="-pie"

据我搜索,我认为 getsubopt 是标准库的一部分。它不是已经包含在我的工具链中了吗?奇怪的是我已经使用我的工具链编译了项目,但是 libnl 失败了。

任何想法如何解决这个问题?:(

标签: androidlinuxandroid-ndkcross-compiling

解决方案


推荐阅读