Я пытаюсь добавить opencv в свою программу, но не могу при запуске:
Код: Выделить всё
#include Код: Выделить всё
Starting build...
cmd /c chcp 65001>nul && C:\MinGW\bin\g++.exe -fdiagnostics-
color=always -g C:\opencv\ObjectDetection\src\main.cpp -o
C:\opencv\ObjectDetection\src\main.exe
C:\opencv\ObjectDetection\src\main.cpp:1:10: fatal error:
opencv2/opencv.hpp: No such file or directory
1 | #include
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Код: Выделить всё
cmake_minimum_required(VERSION 3.10)
project(ObjectDetection)
set(OpenCV_DIR C:/opencv/opencv/build)
find_package(OpenCV REQUIRED)
add_executable(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
Код: Выделить всё
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Selecting Windows SDK version 10.0.22621.0 to target
Windows 10.0.22631.
[cmake] -- OpenCV ARCH: x64\n
[cmake] -- OpenCV RUNTIME: vc16
[cmake] -- OpenCV STATIC: OFF
[cmake] -- Found OpenCV 4.9.0 in C:/opencv/opencv/build/x64/vc16/lib
[cmake] -- You might need to add C:\opencv\opencv\build\x64\vc16\bin
to your PATH to be able to run your applications.
[cmake] -- Configuring done (0.0s)
[cmake] -- Generating done (0.1s)
[cmake] -- Build files have been written to:
C:/opencv/ObjectDetection/build
Please let me know if any additional information is needed.
Источник: https://stackoverflow.com/questions/781 ... -directory
Мобильная версия