【发布时间】:2022-12-10 18:12:26
【问题描述】:
此处的初学者使用 C/C++ 文件构建任务配置。因为我每次都必须在终端中输入以下命令;这完美地编译了我的代码。
g++ Test.cpp -I/usr/include/opencv4 $(pkg-config --libs opencv4) -o Test
但是当我想使用 tasks.json 直接运行代码时,我已经设置了这样的配置。
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"${file}",
"-I/usr/include/opencv4 $(pkg-config --libs opencv4)",
"-o",
"${fileBasenameNoExtension}"
],
"options": {
"cwd": "${fileDirname}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "Task generated by Debugger."
}
],
"version": "2.0.0"
}
我应该在 args 数组中放入什么来解决这个问题?
【问题讨论】:
标签: c++ json visual-studio-code