Hello folks, I have a problem. I want to use openCV with C++ on VSCode but I get the following error fatal error: opencv2/opencv.hpp: No such file or directory. What is the reason of this?
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(uniqTEST)
include(CTest)
enable_testing()
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(uniqTEST main.cpp)
target_link_libraries(uniqTEST ${OpenCV_LIBS})
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_SYSTEM_VERSION 10.0.20348.0)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
-------------------------------------------------------------------
Output:
[main] Configuring project: uniqTEST
[proc] Executing command: "C:\Program Files\CMake\bin\cmake.EXE" --no-warn-unused-cli -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -SC:/Users/arge_ai/Desktop/uniqTEST -Bc:/Users/arge_ai/Desktop/uniqTEST/build -G "Visual Studio 17 2022" -T host=x64 -A x64
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Selecting Windows SDK version 10.0.20348.0 to target Windows 10.0.19044.
[cmake] -- Configuring done (1.8s)
[cmake] -- Generating done (1.4s)
[cmake] -- Build files have been written to: C:/Users/arge_ai/Desktop/uniqTEST/build
[visual-studio] Patch Windows SDK path from C:\Program Files (x86)\Windows Kits\10\bin\x64 to C:\Program Files (x86)\Windows Kits\10\bin\10.0.20348.0\x64 for C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat