android studio中使用cmake常见错误

cmake常见错误

Error:error: linker command failed with exit code 1 (use -v to see invocation)

这是target_link_libraries链接时出现错误。
常见的错误有:

Error:error: cannot find -llibopencv_java

so库不存在,链接时找不到so库;

Error:error: '../../../../src/main/jniLibs/x86/libopencv_java3.so', needed by '../../../../build/intermediates/cmake/debug/obj/x86/libnative-lib.so', missing and no known rule to make it

路径不对找不到so库;

Error:error: undefined reference to 'cv::String::allocate(unsigned int)'
Error:error: undefined reference to 'cv::CascadeClassifier::CascadeClassifier(cv::String const&)'
Error:error: undefined reference to 'cv::String::deallocate()'

这是在target_link_libraries里面没有链接上so库

你可能感兴趣的:(BUG)