标签:mod windows alc command .exe mingw doc lan false
d:/mingw64/bin/
ctrl+shift+x
),搜索Code Runner。task.json(用于build)
{
"version": "2.0.0",
"tasks": [
{
"label": "build hello",
"type": "shell",
"command": "g++",
"args": [
"-g","${file}","-o","${fileDirname}/${fileBasenameNoExtension}.exe" //代表build的是当前文件
],
"group": { //该配置:按ctrl+shift+b就可以直接build当前文件
"kind": "build",
"isDefault": true
}
}
]
}
launch.json(用于调试)
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "d:/mingw64/bin/gdb.exe", //mingw的调试程序所在路径
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build hello" //要与tasks.json中的label属性值一样
}
]
}
windows下使用vscode编写运行以及调试C/C++
C/C++ for Visual Studio Code (Preview)
使用Visual Studio Code开发(编译、调试)C++程序
标签:mod windows alc command .exe mingw doc lan false
原文地址:https://www.cnblogs.com/zhrb/p/10538690.html