Ask Your Question

Revision history [back]

You can use CMAKE method for compiling the code. In CMakeLists.txt, under find_package command, you can specify the exact library version you want to use for compilation. For example.

cmake_minimum_required(VERSION 2.8)

project( DisplayImage )

find_package( OpenCV 4.1.2 REQUIRED )

include_directories( ${OpenCV_INCLUDE_DIRS} )

add_executable( DisplayImage main.cpp )

target_link_libraries( DisplayImage ${OpenCV_LIBS} )