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

created at 09-02-2021 views: 26

The cmakelists.txt file compiles ncnn and cpp and runs normally on the other two ubuntu machines.

The same source code configuration, project loading, and gradle initialization are correct, but an error occurs when compiling the APK.

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

After searching for a long time, I couldn't see the wrong configuration. I suspected the gradle version. After the upgrade, the problem persisted; after upgrading the AS version, the problem still appeared.

Open the settings, sdk configuration, check the sdk tools, reinstall the sdk, the latest SDK 23.0 was installed in one click, the error disappeared, but the compilation still had a problem, it was reduced to SDK 20.0, and the error reappeared.

Android SDK


High is not good, low is not good, choose ndk21.3, cmake3.10.2, finally compile normally, debugging passed.

created at:09-02-2021
edited at: 09-02-2021: