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

问题描述: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)文件中修改一下。

clang++: error: unknown argument: ‘-static-openmp‘_第1张图片

你可能感兴趣的:(笔记)