浅谈vscode中task.json和launch.json的关系

2024-03-01 0 458
目录
  • tasks.json
  • launch.json

tasks.json

{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
\”version\”: \”2.0.0\”,
\”tasks\”: [
{
\”label\”: \”dog\”,
\”type\”: \”shell\”,
\”command\”: \”g++\”,
\”args\”: [\”-g\”, \”${file}\”, \”-std=c++11\”, \”-o\”, \”${fileBasenameNoExtension}.out\”] //相当于 g++ -g main.cpp -std=c++11 -o main.out
}
]
}

launch.json

{ // Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
\”version\”: \”0.2.0\”,
\”configurations\”: [
{
\”name\”: \”(gdb) Launch\”,
\”type\”: \”cppdbg\”,
\”request\”: \”launch\”,
\”program\”: \”${workspaceFolder}/${fileBasenameNoExtension}.out\”,
\”args\”: [],
\”stopAtEntry\”: false,
\”cwd\”: \”${workspaceFolder}\”,
\”environment\”: [],
\”externalConsole\”: false, //如果不要窗口弹出,在ide中显示,就设置成 false
\”MIMode\”: \”gdb\”,
\”preLaunchTask\”: \”dog\”, //表示预先生成一个中间文件,用于g++运行
\”setupCommands\”: [
{
\”description\”: \”Enable pretty-printing for gdb\”,
\”text\”: \”-enable-pretty-printing\”,
\”ignoreFailures\”: true
}
]
}
]
}

浅谈vscode中task.json和launch.json的关系

坐标的label要跟 右边的"preLaunchTask"对应。

"program": "${workspaceFolder}/${fileBasenameNoExtension}.out",则是制定要运行或者调试的可执行文件

到此这篇关于浅谈vscode中task.json和launch.json的关系的文章就介绍到这了,更多相关vscode task.json和launch.json内容请搜索悠久资源网以前的文章或继续浏览下面的相关文章希望大家以后多多支持悠久资源网!

您可能感兴趣的文章:

  • vscode中launch.json和task.json配置教程(重要参数详解)

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 编程综合 浅谈vscode中task.json和launch.json的关系 https://www.u-9.cn/biancheng/bczonghe/181345.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务