我知道这个问题已经问过了,但我不能理解他们的解释。我是完全新的编码,帮助如果你可以。
这是我的文件图像:
这是我的任务jason文件:
{
"version": "2.0.0",
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}",
"`pkg-config",
"--cflags",
"--libs",
"opencv4`"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: /usr/bin/g++"
}
]
}
下面是我的CMakeLists.txt:
cmake_minimum_required(VERSION 3.10)
project(ObjectDetection)
set(OpenCV_DIR C:/Users/prana/OneDrive/Desktop/last_attempt/opencv)
find_package(OpenCV REQUIRED)
add_executable(${PROJECT_NAME} src/Main.cpp)
target_link_libraries(${PROJECT_NAME} ${OpenCV_LIBS})
1条答案
按热度按时间zphenhs41#
尝试添加
/build
进行更改到