title: opencv3.3.0: undefined reference to cv::imwrite - android
body: <p>Android Project that I am facing error has OpenCV &amp; custom implementation of some cpp classes for image processing. I have include <code>opencv-3-3-0-android-sdk</code> in <code>CMakeLists.txt</code> which is used for building native components.</p>
  
  <pre><code> include_directories( ../opencv-3-3-0-android-sdk/sdk/native/jni/include/)
   add_library( lib_opencv
           SHARED
           IMPORTED )
   set_target_properties( lib_opencv
                     PROPERTIES IMPORTED_LOCATION
                     ${PROJECT_SOURCE_DIR}/../opencv-3-3-0-android-sdk/sdk/native/libs/${ANDROID_ABI}/libopencv_java3.so )
  </code></pre>
  
  <p>While invoking following method it throws error:</p>
  
  <pre><code>void saveMat(const cv::Mat&amp; mat, std::string dst){
          cv::imwrite(dst, mat);//throws error - undefined reference
  }
  </code></pre>
  
  <p>Getting following error while running the project which states that cannot reference to imwrite. Though </p>
  
  <pre><code> error: undefined reference to 'cv::imwrite(cv::String const&amp;, cv::_InputArray const&amp;, std::__ndk1::vector&lt;int, std::__ndk1::allocator&lt;int&gt; &gt; const&amp;)'.
  </code></pre>
  
  <p>Though on navigation to that function using ctrl does take me to proper function which is inside <code>opencv2/imgcodecs.hpp</code>.</p>
  
  <pre><code> CV_EXPORTS_W bool imwrite( const String&amp; filename, InputArray img,
            const std::vector&lt;int&gt;&amp; params = std::vector&lt;int&gt;());
  </code></pre>
  
  <p>To me it seems like linkage error. Is there any idea why while running the application it throws above mentioned error?</p>