VScode编译C程序一直显示building
使用VScode编译C程序一直显示building,查看了命令(>c\mingw64\bin\gcc.exe ..\..\c02.c -o ..\..\ c02.exe -g<)也是对的,也输出了.exe程序,但是下方一直显示building,无法进入调试。 可否截个图? qiuyouzhi 发表于 2020-10-23 19:09可否截个图?
公司电脑是不允许传东西出来{:5_92:} 本帖最后由 jitianmoshen 于 2020-10-30 09:56 编辑
项目目录里有个.vscode,里面有launch.json,task.json,也可以有settings.json
这个是launch.json,你把miDebuggerPath按照你的路径改下,我用的mingw64
{
"version": "0.2.0",
"configurations": [
{
"name": "gcc.exe - 生成和调试活动文件",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc.exe build active file"
}
]
}
这个是task.json
{
"tasks": [
{
"type": "shell",
"label": "C/C++: gcc.exe build active file",
"command": "C:\\mingw64\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
],
"version": "2.0.0"
}
下面是settings.json, 这个是我装着CLANG, 是防止CLANG报莫名其妙的错误的
{
"clang.diagnostic.enable": false,
"files.associations":
{
"1.C": "cpp",
"cstdio": "c"
}
}
页:
[1]