大佬们:刚装的环境 学习C语言 代码示例调试时提示:lanch:program‘E:\develop\Visual Stodio Code\a.exe'does not exit。调了半天,请大佬们指出问题在哪?
程序代码
#include <stdio.h>
int g_var=0;
void print_line(char *str)
{
if(str!=NULL)
printf("%s\r\n",str);
else
printf("null string\r\n");
}
int main(int argc, char const *argv[])
{
int l_var=1;
print_line("hello world");
printf("g_var=%d,l_var=%d.\r\n",g_var,l_var);
return 0;
}
takks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"command": "gcc",
"args": [
"-g",
"${file}",
"-o",
"${workspaceRoot}/hello.exe"
],
"problemMatcher": {
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
lanuch.json
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "/path/to/gdb.exe",// "miDebuggerPath": "/path/to/gdb"
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false// "ignoreFailures": true
}
],
"preLaunchTask": "gcc",//原来没有
}
]