Cannot get OpenCV to compile because of undefined references?

后端 未结 6 1343
再見小時候
再見小時候 2020-12-02 14:52

The code is simple and is essentially straight from this tutorial. I am running Arch Linux and have the OpenCV library stored at /usr/include/. I have also chec

6条回答
  •  情歌与酒
    2020-12-02 14:58

    For me, this type of error:

    mingw-w64-x86_64/lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld: mingw-w64-x86_64/x86_64-w64-mingw32/lib/libTransform360.a(VideoFrameTransform.cpp.obj):VideoFrameTransform.cpp:(.text+0xc7c):
    undefined reference to `cv::Mat::Mat(cv::Mat const&, cv::Rect_ const&)'
    

    meant load order, I had to do -lTransform360 -lopencv_dnn345 -lopencv... just like that, that order. And putting them right next to each other helped too, don't put -lTransform360 all the way at the beginning...or you'll get, for some freaky reason:

    undefined reference to `VideoFrameTransform_new'
    undefined reference to `VideoFrameTransform_generateMapForPlane'
    

    ...

提交回复
热议问题