clang++: error: unknown argument: ‘-static-openmp‘

2023-12-15 19:24:46

问题描述:clang++:?error:?unknown?argument:?'-static-openmp'

在将YOLO部署在手机端时,出现了这个错误No?toolchains?found?in?the?NDK?toolchains?folder?for?ABI?with?prefix:?arm-linux-androideabi

某些博客写的是使用低版本的NDK,比如20.0.5594570。

但是虽然不报No?toolchains?found?in?the?NDK?toolchains?folder?for?ABI?with?prefix:?arm-linux-androideabi错误了,但是报出了clang++:?error:?unknown?argument:?'-static-openmp'错误。

cmd.exe /C "cd . && C:\Users\aoqia\AppData\Local\Android\Sdk\ndk\20.0.5594570\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android24 --gcc-toolchain=C:/Users/aoqia/AppData/Local/Android/Sdk/ndk/20.0.5594570/toolchainsvm/prebuilt/windows-x86_64 --sysroot=C:/Users/aoqia/AppData/Local/Android/Sdk/ndk/20.0.5594570/toolchainsvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security   -O0 -fno-limit-debug-info  -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libyolov5ncnn.so -o D:\AAAAA\ncnn-android-yolov5-master\app\build\intermediates\cmake\debug\obj\arm64-v8a\libyolov5ncnn.so CMakeFiles/yolov5ncnn.dir/yolov5ncnn_jni.cpp.o  D:/AAAAA/ncnn-android-yolov5-master/appc/main/jni/arm64-v8abbncnn.a -ljnigraphics -fopenmp -static-openmp -Wl,-wrap,__kmp_affinity_determine_capable C:/Users/aoqia/AppData/Local/Android/Sdk/ndk/20.0.5594570/toolchainsvm/prebuilt/windows-x86_64/sysroot/usrb/aarch64-linux-android/24bvulkan.so D:/AAAAA/ncnn-android-yolov5-master/appc/main/jni/arm64-v8abbglslang.a D:/AAAAA/ncnn-android-yolov5-master/appc/main/jni/arm64-v8abbSPIRV.a D:/AAAAA/ncnn-android-yolov5-master/appc/main/jni/arm64-v8abbMachineIndependent.a D:/AAAAA/ncnn-android-yolov5-master/appc/main/jni/arm64-v8abbOGLCompiler.a D:/AAAAA/ncnn-android-yolov5-master/appc/main/jni/arm64-v8abbOSDependent.a D:/AAAAA/ncnn-android-yolov5-master/appc/main/jni/arm64-v8abbGenericCodeGen.a -landroid -ljnigraphics -llog -latomic -lm && cd ."

clang++: error: unknown argument: '-static-openmp'

解决办法:

在build.gradle(:app)文件中修改一下。

文章来源:https://blog.csdn.net/weixin_43501408/article/details/135019261
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。