淺談vscode中task.json和launch.json的關系
更新時間:2023年08月01日 14:57:26 作者:thequitesunshine007
本文主要介紹了淺談vscode中task.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 } ] } ] }
坐標的label要跟 右邊的 "preLaunchTask"對應。
"program": "${workspaceFolder}/${fileBasenameNoExtension}.out",則是制定要運行或者調(diào)試的可執(zhí)行文件
到此這篇關于淺談vscode中task.json和launch.json的關系的文章就介紹到這了,更多相關vscode task.json和launch.json內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
設計引導--一個鴨子游戲引發(fā)的設計理念(多態(tài),繼承,抽象,接口,策略者模式)
設計引導--一個鴨子游戲引發(fā)的設計多態(tài),繼承,抽象,接口,策略者模式;這篇博文是從實際生活中,提煉出來的設計理念,它現(xiàn)在是骨架,現(xiàn)在我加以代碼實例,完成程序的血肉,以求讓大家活生生的體會設計中的精髓2013-01-01插件下載安裝系列Eclipse/IDEA/谷歌/火狐安裝插件
這篇文章主要介紹了插件下載安裝系列Eclipse/IDEA/谷歌/火狐,本文通過圖文并茂的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-10-10詳解git submodule HEAD detached 的問題
這篇文章主要介紹了詳解git submodule HEAD detached 的問題,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2020-08-08