|
发表于 2019-11-17 19:53:34
|
显示全部楼层
本帖最后由 bin554385863 于 2019-11-17 20:01 编辑
launch.json
- {
- // 使用 IntelliSense 了解相关属性。
- // 悬停以查看现有属性的描述。
- // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "name": "g++.exe build and debug active file",
- "type": "cppdbg",
- "request": "launch",
- "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
- "args": [],
- "stopAtEntry": false,
- "cwd": "${workspaceFolder}",
- "environment": [],
- "externalConsole": false,//如果为true,调试的时候会打开命令行窗口
- "MIMode": "gdb",
- "miDebuggerPath": "D:\\MinGW\\bin\\gdb.exe",//****************************文件GDB的路径
- "setupCommands": [
- {
- "description": "为 gdb 启用整齐打印",
- "text": "-enable-pretty-printing",
- "ignoreFailures": true
- }
- ],
- "preLaunchTask": "g++.exe build active file"
- }
- ]
- }
复制代码
task.json
- {
- "tasks": [
- {
- "type": "shell",
- "label": "g++.exe build active file",
- "command": "D:\\MinGW\\bin\\g++.exe",//******************************文件G++的路径
- "args": [
- "-g",
- "${file}",
- "-o",
- "${fileDirname}\\${fileBasenameNoExtension}.exe"
- ],
- "options": {
- "cwd": "D:\\MinGW\\bin"//******************************bin文件夹的路径
- }
- }
- ],
- "version": "2.0.0"
- }
复制代码
你把MinGW下面的
bin文件夹,
include文件夹
还有lib文件夹的路径添加到系统环境变量Path里面,一定是系统环境变量.然后把我上面发的带*号注释部分修改成你的文件所在的路径.然后放到.vscode文件夹里面. |
|