OpenCV undefinierte Referenzen

Ich versuche, meine JNI Android Applikation mit OpenCV zu verknüpfen, aber ich bekomme diese Fehler

./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 

Ich verknüpfe mit 3 Modulen: opencv_core opencv_calib3d opencv_imgproc. Was vermisse ich ?

Bearbeiten. Ich habe opencv_flann Bibliothek hinzugefügt und die Fehlerzählung reduziert. Aber wo sind cv :: line oder zB cv :: rectangle sind definiert?

  • Bildsegmentierung nach Hintergrundfarbe - OpenCV Android
  • Android java opencv 2.4 konvexhull konvexdefekt
  • Was ist der Unterschied zwischen `opencv.android.JavaCameraView` und` opencv.android.NativeCameraView`
  • Wie kann man überprüfen, ob zwei Bilder ähnlich sind oder nicht mit openCV in Java?
  • Wie integriere ich OpenCV Manager in Android App
  • Verwenden von OpenCV in Java Camera2 API
  • Wie man herausfindet erkanntes Gesicht ist real oder falsch
  • Erstellen von Android-Bibliothekspaket einschließlich externes (Native oder Java) Paket
  • 3 Solutions collect form web for “OpenCV undefinierte Referenzen”

    Das Problem war in der Bibliotheksordnung. Die richtige Reihenfolge ist:

     LOCAL_STATIC_LIBRARIES := libopencv_calib3d opencv_features2d opencv_flann opencv_imgproc opencv_core 

    Also das Hauptprinzip ist, dass du Bibliotheken in umgekehrter Reihenfolge ihrer Abhängigkeit deklarieren musst (zB * opencv_imgproc * hängt ab von * opencv_core * und * opencv_features2d * hängt von * opencv_imgproc * und so weiter ab).

    Sie fehlen opencv_highgui und wahrscheinlich auch opencv_features2d .

    cv::rectangle ist bei opencv_core definiert.

    Stellen Sie sicher, dass Ihre Datei mit allen diesen Bibliotheken verknüpft ist.

    Sie können auch die Ausgabe von pkg-config --static --libs opencv , um die Bibliotheken in der richtigen Reihenfolge zu ordnen.

    Das Android ist ein Google Android Fan-Website, Alles ├╝ber Android Phones, Android Wear, Android Dev und Android Spiele Apps und so weiter.