我用VS code 学习C语言,想打印出 Hello World,可是调试之后出现了一个.exe 文件,那个黑色窗口也没有显示出来.
打开.exe文件后出现乱码, 有没有大佬帮我看一下?
这是launch.json 文件代码
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "gcc.exe build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "D:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "gcc.exe build active file"
}
]
}
这是tasks.json文件代码
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "gcc.exe build active file",
"command": "D:\\MinGW\\bin\\gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "D:\\MinGW\\bin"
},
"problemMatcher": [
"$gcc"
],
"group": "build"
}
]
}
我的电脑已经装好了C/C++插件和 run code插件, 以及相应的MinGW, 但是运行的时候那个黑窗窗出不来, 运行后又出现了.exe 文件, 却是乱码.