opencv需要gunstl
opencv 3.4.3版本,在android studio中编译,
build.gradle
externalNativeBuild {
cmake {
cppFlags "-std=c++11 -frtti -fexceptions"
abiFilters "arm64-v8a"
arguments '-DANDROID_STL=gnustl_shared'
//arguments "-DANDROID_ALLOW_UNDEFINED_SYMBOLS=TRUE"
}
}
cmake {
cppFlags "-std=c++11 -frtti -fexceptions"
abiFilters "arm64-v8a"
arguments '-DANDROID_STL=gnustl_shared'
//arguments "-DANDROID_ALLOW_UNDEFINED_SYMBOLS=TRUE"
}
}
发现找不到libgunstl_shared.so
Expected NDK STL shared object file at <NDK>/soureces/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/libgunstl_shared.so
打开ndk(版本为r18)目录下的CHANGELOG.md,有如下内容
CHANGELOG.md
* gnustl, gabi++, and stlport have been removed.
下载NDK r16,设置为当前工程的NDK
File --> Project Structure --> SDK Location --> Android NDK Location
编译通过
坑在于:文档并没有说明OpenCV编译需要gnustl,有人是把OpenCV的库用libc++重新编译了,这个工作对于一般的库用户来说太难了。
参考:https://stackoverflow.com/questions/52410712/ndk-problems-after-gnustl-has-been-removed-from-the-ndk-revision-r18
相关推荐
me 2018-10-07
绿豆饼 2020-05-26
zhongzhiwei 2020-05-07
hqulyc 2020-04-22
Jemy杰 2012-07-08
yuemeng0 2012-07-08
zuihaobushi 2012-07-08
yinbaoshiguang 2010-08-29
Urchindong 2010-08-17
luoj 2011-02-20
老菜鸟自习室 2011-02-18
yuanzhiweiss 2011-08-22
wintering 2011-08-20
nickey 2011-08-17
newtrekWang 2011-08-16
西木 2011-08-16
taiyuanwuyin 2011-08-16
移动视频探索者 2011-04-28