当前位置: 代码迷 >> 综合 >> Ubuntu vscode的C++ tasks.json
  详细解决方案

Ubuntu vscode的C++ tasks.json

热度:70   发布时间:2023-12-22 13:14:56.0

需要看配置过程的动画,及相关参数设置的含义的,请转:再写ubuntu 下 VS code的C++配置——gcc和clang

 

tasks.json自己新建(保存在.vscode里),自动生成的差别太大了。

{// 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": "g++","args": ["-g","${workspaceFolder}/list_test.cpp","--std=c++11","-o","build"],"problemMatcher": ["$gcc"]}]
}

launch.json在vscode里添加,只需要修改“program”。

{// 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}/build","args": [],"stopAtEntry": false,"cwd": "${workspaceFolder}","environment": [],"externalConsole": true,"MIMode": "gdb","setupCommands": [{"description": "Enable pretty-printing for gdb","text": "-enable-pretty-printing","ignoreFailures": true}]}]
}

 

 

 

 

 

 

  相关解决方案