我正在vscode中使用c ++。每次创建并使用新的cpp文件时,都必须配置launch.json文件。否则,它将执行我以前处理过的文件。
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/nxtPrime.cpp.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\mingw\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "echo"
}
]
}
有没有一种简单的方法,这样我就不必每次都编辑启动文件以提供新的cpp文件的名称了?
先谢谢了。