[안드로이드] undefined reference to `cv::imwrite(cv::String const&, cv::_InputArray const&, std::__ndk1::vector<int, std::__ndk1::allocator<int> > const&)'
안드로이드에서 CMake를 사용해서 OpenCV를 사용한 JNI 함수를 만들다 보면 imwrite 부분이 컴파일이 안 되는 경우가 있습니다. 이 때에는 gradle 파일에 다음과 같이 arguments '-DANDROID_STL=gnustl_shared' 을 추가해 주면 됩니다.
android {
// ...
defaultConfig {
// ...
externalNativeBuild {
cmake {
arguments '-DANDROID_STL=gnustl_shared' // needed to enable imwrite
}
}
}
}
'전산 > 안드로이드' 카테고리의 다른 글
[안드로이드] CMakeLists.txt 파일 설명 (0) | 2018.11.19 |
---|---|
[안드로이드] Error:Could not find method jackOptions() for arguments (0) | 2018.09.19 |
[안드로이드] No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android (2) | 2018.09.19 |
[안드로이드] no original dex files found for dex location (0) | 2018.08.02 |
[안드로이드] error: package R does not exist (0) | 2018.05.25 |