简体   繁体   中英

How to build OpenCV for Android using Clang and the latest NDK r15b

How can I build OpenCV for Android using Clang and the latest NDK r15b? On the latest NDK r15b toolchains folder does not contain special subfolders with Clang except llvm and android.toolchain.cmake script ignores llvm subfolder. So I can't figure out how to make things work?

You can compile it like this:

cd $OPENCV_SRC_DIR
mkdir build
export ANDROID_NDK=$YOUR_NDK_PATH
cmake -DCMAKE_TOOLCHAIN_FILE=$YOUR_NDK_PATH/build/cmake/android.toolchain.cmake  ..
make -j7
make install
cd install

NOTE:

Tested with the last ndk16 version + opencv-2.4.11.

(Clang is the default compiler in the new ndk's)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM