我正在尝试将JNI Android应用程序与OpenCV链接,但我遇到了这些错误。
./obj/local/armeabi
/libopencv_calib3d.a(calibinit.cpp.o): In function `cvDrawChessboardCorners':
calibinit.cpp:(.text+0x20a): undefined reference to `cvLine'
calibinit.cpp:(.text+0x244): undefined reference to `cvLine'
calibinit.cpp:(.text+0x26e): undefined reference to `cvCircle'
calibinit.cpp:(.text+0x2ec): undefined reference to `cvLine'
calibinit.cpp:(.text+0x4ce): undefined reference to `cvLine'
calibinit.cpp:(.text+0x504): undefined reference to `cvLine'
calibinit.cpp:(.text+0x532): undefined reference to `cvCircle'
./obj/local/armeabi/libopencv_calib3d.a(calibinit.cpp.o): In function `cvFindChessboardCorners':
calibinit.cpp:(.text+0x1b6a): undefined reference to `cvRectangle'
./obj/local/armeabi/libopencv_calib3d.a(calibinit.cpp.o): In function `cv::findCirclesGrid(cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, int, cv::Ptr<cv::FeatureDetector> const&)':
calibinit.cpp:(.text+0x5058): undefined reference to `cv::FeatureDetector::detect(cv::Mat const&, std::vector<cv::KeyPoint, std::allocator<cv::KeyPoint> >&, cv::Mat const&) const'
./obj/local/armeabi/libopencv_calib3d.a(circlesgrid.cpp.o): In function `cv::findCirclesGridDefault(cv::_InputArray const&, cv::Size_<int>, cv::_OutputArray const&, int)':
circlesgrid.cpp:(.text+0x2ce): undefined reference to `cv::SimpleBlobDetector::Params::Params()'
circlesgrid.cpp:(.text+0x2dc): undefined reference to `cv::SimpleBlobDetector::SimpleBlobDetector(cv::SimpleBlobDetector::Params const&)'
./obj/local/armeabi/libopencv_calib3d.a(circlesgrid.cpp.o): In function `CirclesGridFinder::drawHoles(cv::Mat const&, cv::Mat&) const':
circlesgrid.cpp:(.text+0xa56): undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
circlesgrid.cpp:(.text+0xafa): undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
circlesgrid.cpp:(.text+0xb44): undefined reference to `cv::circle(cv::Mat&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
./obj/local/armeabi/libopencv_calib3d.a(circlesgrid.cpp.o): In function `CirclesGridFinder::drawBasis(std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > const&, cv::Point_<float>, cv::Mat&) const':
circlesgrid.cpp:(.text+0x106c): undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
./obj/local/armeabi/libopencv_calib3d.a(circlesgrid.cpp.o): In function `CirclesGridFinder::drawBasisGraphs(std::vector<Graph, std::allocator<Graph> > const&, cv::Mat&, bool, bool) const':
circlesgrid.cpp:(.text+0x133c): undefined reference to `cv::circle(cv::Mat&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
circlesgrid.cpp:(.text+0x13bc): undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
./obj/local/armeabi/libopencv_calib3d.a(circlesgrid.cpp.o): In function `CirclesGridClusterFinder::parsePatternPoints(std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > const&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > > const&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&)':
circlesgrid.cpp:(.text+0x3292): undefined reference to `cv::flann::LinearIndexParams::LinearIndexParams()'
circlesgrid.cpp:(.text+0x32c6): undefined reference to `cv::flann::Index::Index(cv::_InputArray const&, cv::flann::IndexParams const&, cvflann::flann_distance_t)'
circlesgrid.cpp:(.text+0x346a): undefined reference to `cv::flann::SearchParams::SearchParams(int, float, bool)'
circlesgrid.cpp:(.text+0x347e): undefined reference to `cv::flann::Index::knnSearch(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, cv::flann::SearchParams const&)'
circlesgrid.cpp:(.text+0x3484): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text+0x3658): undefined reference to `cv::flann::Index::~Index()'
circlesgrid.cpp:(.text+0x365e): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text+0x36b6): undefined reference to `cv::flann::Index::~Index()'
circlesgrid.cpp:(.text+0x36bc): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text+0x3702): undefined reference to `cv::flann::IndexParams::~IndexParams()'
circlesgrid.cpp:(.text+0x370c): undefined reference to `cv::flann::Index::~Index()'
./obj/local/armeabi/libopencv_calib3d.a(circlesgrid.cpp.o): In function `CirclesGridFinder::computeRNG(Graph&, std::vector<cv::Point_<float>, std::allocator<cv::Point_<float> > >&, cv::Mat*) const':
circlesgrid.cpp:(.text+0x4b2a): undefined reference to `cv::line(cv::Mat&, cv::Point_<int>, cv::Point_<int>, cv::Scalar_<double> const&, int, int, int)'
circlesgrid.cpp:(.text+0x4b7e): undefined reference to `cv::circle(cv::Mat&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
circlesgrid.cpp:(.text+0x4bd4): undefined reference to `cv::circle(cv::Mat&, cv::Point_<int>, int, cv::Scalar_<double> const&, int, int, int)'
./obj/local/armeabi/libopencv_imgproc.a(contours.cpp.o): In function `cv::drawContours(cv::_OutputArray const&, cv::_InputArray const&, int, cv::Scalar_<double> const&, int, int, cv::_InputArray const&, int, cv::Point_<int>)':
contours.cpp:(.text+0x3fd2): undefined reference to `cvDrawContours'
./obj/local/armeabi/libopencv_imgproc.a(samplers.cpp.o): In function `cvSampleLine':
samplers.cpp:(.text+0x65a2): undefined reference to `cvInitLineIterator'
./obj/local/armeabi/libopencv_imgproc.a(templmatch.cpp.o): In function `cv::crossCorr(cv::Mat const&, cv::Mat const&, cv::Mat&, cv::Size_<int>, int, cv::Point_<int>, double, int)':
templmatch.cpp:(.text+0x47e): undefined reference to `cv::getOptimalDFTSize(int)'
templmatch.cpp:(.text+0x494): undefined reference to `cv::getOptimalDFTSize(int)'
templmatch.cpp:(.text+0x92c): undefined reference to `cv::dft(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
templmatch.cpp:(.text+0xfa4): undefined reference to `cv::dft(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
templmatch.cpp:(.text+0x1006): undefined reference to `cv::mulSpectrums(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, int, bool)'
templmatch.cpp:(.text+0x102e): undefined reference to `cv::dft(cv::_InputArray const&, cv::_OutputArray const&, int, int)'
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libarengine.so] Error 1
我正在链接三个模块:opencv_core,opencv_calib3d和opencv_imgproc。我还缺少什么?
编辑。 我已经添加了opencv_flann库并减少了错误计数。但是cv::line或者例如cv::rectangle在哪里定义的?