title: OpenCV 4.0.1 link failure in Android
body: <p>I am migrating the OpenCV library from 3.2.0 to 4.0.1. In the process discovered that lot of macros have been redefined to more C++ style like CV_BGR2RGB is now COLOR_BGR2RGB.</p>
  
  <p>Currently faced with following link errors when trying to link ../native/libs/x86_64/libopencv_java4.so as follows</p>
  
  <pre><code>native/jni/include\opencv2/core/mat.inl.hpp:548: error: undefined reference to 'cv::error(int, std::string const&amp;, char const*, char const*, int)'
  
  native/jni/include\opencv2/core/mat.inl.hpp:561: error: undefined reference to 'cv::error(int, std::string const&amp;, char const*, char const*, int)'
  
  xxx_std.h:355: error: undefined reference to 'cv::putText(cv::_InputOutputArray const&amp;, std::string const&amp;, cv::Point_&lt;int&gt;, int, double, cv::Scalar_&lt;double&gt;, int, int, bool)'
  
  LabelUtils.cpp:1225: error: undefined reference to 'cv::putText(cv::_InputOutputArray const&amp;, std::string const&amp;, cv::Point_&lt;int&gt;, int, double, cv::Scalar_&lt;double&gt;, int, int, bool)'
  
  LabelUtils.cpp:2512: error: undefined reference to 'cv::imwrite(std::string const&amp;, cv::_InputArray const&amp;, std::vector&lt;int, std::allocator&lt;int&gt; &gt; const&amp;)'
  
  TrackingCodeDeSkew.cpp:553: error: undefined reference to 'cv::putText(cv::_InputOutputArray const&amp;, std::string const&amp;, cv::Point_&lt;int&gt;, int, double, cv::Scalar_&lt;double&gt;, int, int, bool)'
  
  TrackingCodeDeSkew.cpp:557: error: undefined reference to 'cv::putText(cv::_InputOutputArray const&amp;, std::string const&amp;, cv::Point_&lt;int&gt;, int, double, cv::Scalar_&lt;double&gt;, int, int, bool)'
  </code></pre>
  
  <p>This is the linker command line </p>
  
  <pre><code>    C:\Users\koush\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe  --target=x86_64-none-linux-android --gcc-toolchain=C:/Users/koush/AppData/Local/Android/Sdk/ndk-bundle/toolchains/x86_64-4.9/prebuilt/windows-x86_64 --sysroot=C:/Users/koush/AppData/Local/Android/Sdk/ndk-bundle/sysroot -fPIC -isystem C:/Users/koush/AppData/Local/Android/Sdk/ndk-bundle/sysroot/usr/include/x86_64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat
  &lt;&lt;list of generated object files&gt;&gt; -llog OpenCV401/native/libs/x86_64/libopencv_java4.so src/main/jniLibs/x86_64/libzbarjni.so src/main/jniLibs/x86_64/libiconv.so -landroid -latomic -lm "C:/Users/koush/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libsupc++.a" "C:/Users/koush/AppData/Local/Android/Sdk/ndk-bundle/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64
  /libgnustl_shared.so"
  </code></pre>