I get strange link errors when trying to use opencv with crystax, clang and the gradle experimental plugin.
I build opencv according to the instructions at
http://silverglint.com/opencv-on-android/ Modify the google sample:
https://github.com/googlesamples/android-ndk/tree/gradle-experimental/hello-libs so that it uses opencv.
my .cpp files contains something like:
#include <opencv2/core.hpp>
int cpus = cv::getNumberOfCPUs();
std:string buildInfo = cv::getBuildInformation();
This builds and runs fine with:
google ndk & gcc
google ndk and clang
crystax ndk and gcc
get strange link errors however if I try to use clang with crystax
error: undefined reference to 'cv::getBuildInformation()'
clang: error: linker command failed with exit code 1
Even more strange is that the linker has no trouble with cv::getNumberOfCPUs()
(If I comment out just the cv::getBuildInformation() line then the app runs fine)
even though both functions are defined in the same header and defined in the same libopencv_core.so
moduules/core
"core.hpp"
CV_EXPORTS_W int getNumberOfCPUs();
CV_EXPORTS_W const string& getBuildInformation();
"system.cpp"
namespace cv { const std::string& getBuildInformation() }
"parallel.cpp"
int cv::getNumberOfCPUs(void)
Im using Android Crystax nightly build from Dec 9 and the current Android Studio 2.2.3
(gradle-experimental:0.8.3) and opencv 2.4
Any ideas would be greatly appreciated.