Running multiple versions of OpenCV on the same computer

前端 未结 3 554
孤独总比滥情好
孤独总比滥情好 2021-02-04 02:01

My computer is running Ubuntu-16.04-LTS and OpenCV-2.4.13 is already installed on it. However, I would like to use the functionalities of newer versions of OpenCV, such as OpenC

3条回答
  •  死守一世寂寞
    2021-02-04 02:32

    Indeed, you're linking against system-default version of OpenCV.

    Reconfigure your project by calling CMake with right path to file OpenCVConfig.cmake.

    cmake /path/to/your/sources -DOpenCV_DIR=/home/ubuntu/opencv-3.2.0

    Find file CMakeCache.txt in your build directory. It contains internal CMake variables, OpenCV paths are also there.

    Also, it is incorrect to hardcode paths. Use include_directories(${OPENCV_INCLUDE_DIRS})

    And quotation from OpenCVConfig.cmake

      - OpenCV_LIB_DIR                  : The directory(es) where lib files are. Calling LINK_DIRECTORIES
                                         with this path is NOT needed.
    

提交回复
热议问题