clang++.exe: error: er command failed with exit code 1 错误解决方法
错误信息如下:
Build command failed.
Error while executing process D:\\sdk\\cmake\\3.6.4111459\\bin\\cmake.exe with arguments {--build D:\\master\\app\\.externalNativeBuild\\cmake\\debug\\armeabi-v7a --target qg}
[1/1] ing CXX shared library ..\\..\\..\\..\\build\\intermediates\\cmake\\debug\\obj\\armeabi-v7a\\libqg.so
FAILED: cmd.exe /C \"cd . && D:\\sdk\\ndk-bundle\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin\\clang++.exe --target=armv7-none-linux-androideabi19 --gcc-toolchain=D:/sdk/ndk-bundle/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 --sysroot=D:/sdk/ndk-bundle/sysroot -fPIC -isystem D:/sdk/ndk-bundle/sysroot/usr/include/arm-linux-androideabi -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11 -std=c++11 -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -nostdlib++ --sysroot D:/sdk/ndk-bundle/platforms/android-19/arch-arm -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--fix-cortex-a8 -Wl,--exclude-libs,libunwind.a -LD:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro
省略一万字
\"D:/sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_static.a\" && cd .\"
D:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/stdexcept:136: error: undefined reference to \'std::logic_error::logic_error(char const*)\'
D:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/stdexcept:136: error: undefined reference to \'std::logic_error::logic_error(char const*)\'
D:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/stdexcept:146: error: undefined reference to \'std::logic_error::logic_error(char const*)\'
D:/sdk/ndk-bundle/sources/cxx-stl/llvm-libc++/include/stdexcept:136: error: undefined reference to \'std::logic_error::logic_error(char const*)\'
clang++.exe: error: er command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
解决方法:
-
一般是ndk版本问题,用SDK Manager去下载后,仍然失败,下载的版本是18
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
-
从官网下载ndk版本 android-ndk-r16b-windows-x86_64.zip
下载地址:https://developer.android.com/ndk/downloads/?hl=zh-cn -
替换原来sdk目录下的android-ndk
注意:用哪个版本的ndk还是看具体项目工程。
继续阅读与本文标签相同的文章
-
2019 年度 “CCF 杰出会员” 公布,清华北大等86人当选
2026-05-18栏目: 教程
-
3步轻松搞定Spring Boot缓存
2026-05-18栏目: 教程
-
5G机皇已来 三星Galaxy Note10+5G正式登陆中国
2026-05-18栏目: 教程
-
威特动力:从“制造”到“智造”的跨越
2026-05-18栏目: 教程
-
Nreal携手运营商KDDI,共推日本MR生态建设
2026-05-18栏目: 教程
