Cannot get OpenCV to compile because of undefined references?

后端 未结 6 1349
再見小時候
再見小時候 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 15:04

    I have tried all solution. The -lopencv_core -lopencv_imgproc -lopencv_highgui in comments solved my problem. And know my command line looks like this in geany:

    g++ -lopencv_core -lopencv_imgproc -lopencv_highgui  -o "%e" "%f"
    

    When I build:

    g++ -lopencv_core -lopencv_imgproc -lopencv_highgui  -o "opencv" "opencv.cpp" (in directory: /home/fedora/Desktop/Implementations)
    

    The headers are:

    #include "opencv2/imgproc/imgproc.hpp"
    #include "opencv2/highgui/highgui.hpp"
    

提交回复
热议问题