NDK r16b 独立工具链错误:"/usr/bin/ld: this linker was not configured to use sysroots"

NDK r16b standalone toolchain error: "/usr/bin/ld: this linker was not configured to use sysroots"

本文关键字:was linker not sysroots use to configured this usr 工具 独立      更新时间:2023-10-16

我正在尝试使用Android NDK构建一个应用程序。编译成功,但在链接步骤中失败,错误如下:

1> /usr/bin/ld: this linker was not configured to use sysroots
clang50++.exe: error: linker command failed with exit code 1 (use -v to see invocation)

我正在使用

--sysroot=<MyNDKPath>/sysroot 

-isystem <MyNDKPath>/sysroot/usr/include/arm-linux-androideabi 

编译时

谁能帮我解决这个问题?

对我来说,

这是一条通往 ld 的缺失之路。我将其添加到 Eclipse 中的 PATH 环境变量中,它起作用了:

${ANDROID_NDK}toolchainsaarch64-linux-android-4.9prebuiltwindows-x86_64bin