{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**",
"${OPENCV454}/include", //vscode 引用目录,以便include不出现红色波浪线
"${OPENCV454}/include/opencv2",
"./debug",
"./" //vscode 引用目录,以便include不出现红色波浪线
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "10.0.22000.0",
"compilerPath": "D:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.32.31326\\bin\\Hostx64\\x64\\cl.exe",
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "windows-msvc-x64"
}
],
"version": 4
}
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "cl.exe",
"args": [
"/EHsc", //指定异常处理模型/EH{s/a}[c][r][-]
"${file}",
"/Zi", //产生完整的调试信息
"/Fe:", //重命名执行文件
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"/Fo:",
"${fileDirname}\\",
"/nologo",
"/I", //指定include文件搜索路径
"./",
"/I",
"${env:OPENCV454}\\include",
"/I",
"${env:OPENCV454}\\include\\opencv2",
"/link",
"${env:OPENCV454}\\x64\\vc15\\lib\\opencv_world454d.lib",
"./debug/zkAlgDll.lib",
// Ask msbuild to generate full paths for file names.
//"/property:GenerateFullPaths=true",
//"/t:build",
// Do not generate summary otherwise it leads to duplicate errors in Problems panel
//"/consoleloggerparameters:NoSummary"
],
"group": "build",
"presentation": {
// Reveal the output only if unrecognized errors occur.
"reveal": "silent"
},
// Use the standard MS compiler pattern to detect errors, warnings and infos
"problemMatcher": "$msCompile"
}
]
}
{
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": true, //在main入口处停止
"cwd": "${fileDirname}",
"environment": [],
"console": "externalTerminal",
"preLaunchTask": "build"
}
],
"version": "2.0.0"
}
这里比较简单
链接: 多个.cpp文件