I added a simple exception in native-lib.cpp and the app crashed.
extern "C"
{
void JNICALL Java_ch_hepia_iti_opencvnativeandroidstudio_MainActivity_salt(JNIEnv *env, jobject instance,
jlong matAddrGray,
jint nbrElem) {
try {
throw logic_error("");
}
catch (logic_error) {
}
Mat &mGr = *(Mat *) matAddrGray;
for (int k = 0; k < nbrElem; k++) {
int i = rand() % mGr.cols;
int j = rand() % mGr.rows;
mGr.at<uchar>(j, i) = 255;
}
}
}
And the program work perfect without lib_opencv.
target_link_libraries( # Specifies the target library.
native-lib
# OpenCV lib
# lib_opencv
# Links the target library to the log library
# included in the NDK.
${log-lib} )
I added a simple exception in native-lib.cpp and the app crashed.
And the program work perfect without lib_opencv.