OpenCV - undefined reference to 'cv::CascadeClassifier::detectMultiScale() after NDK update

后端 未结 5 1309

Yesterday I updated my Android Studio included NDK to version 17.0.4754217and since then I can\'t run my app anymore. When I tried to rerun the code after the u

5条回答
  •  不要未来只要你来
    2021-01-06 07:33

    When linkin opencv with your project executables, you always have to link with the general library -lopencv_core. But some packages require additional link flags. For example, if you use highgui as in

    #include 
    

    you must add opencv_highgui link flag for : -lopencv_highgui.

    In you case, CascadeClassifiers are defined in

    #include "opencv2/objdetect.hpp"
    

    and thus requires a link with opencv_objdetect -lopencv_objdetect.

    The solution is to add the link flag -lopencv_objdetect when compiling.

提交回复
热议问题