c++ - vscode 构建,创建 exe 文件,突然不再启动(C++)
问题描述
每当我按下 F5 时,VSCode 一直使用 raylib 和 C++ 从 main 构建、创建和运行 .exe 文件。然而,它突然停止了,我不知道为什么。
完成构建和创建 .exe 终端后,它只会说:“终端将被任务重用,按任意键关闭它”。
.exe 文件被创建并放在文件夹中。按 F5 时,如何让它返回构建、创建和运行 .exe?
任务.json
{
"type": "cppbuild",
"label": "C/C++: gcc.exe build active file",
"command": "C:/raylib/mingw/bin/gcc.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "C:/raylib/mingw/bin"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
},
"detail": "compiler: C:/raylib/mingw/bin/gcc.exe"
}
启动.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": "Debug",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": false
}
],
"windows": {
"miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe",
},
"osx": {
"MIMode": "lldb"
},
"linux": {
"miDebuggerPath": "/usr/bin/gdb",
},
"preLaunchTask": "build debug"
},
{
"name": "Run",
"type": "cppdbg",
"request": "launch",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"program": "${workspaceFolder}/${fileBasenameNoExtension}",
"MIMode": "gdb",
"windows": {
"program": "${workspaceFolder}/${fileBasenameNoExtension}.exe",
"miDebuggerPath": "C:/raylib/mingw/bin/gdb.exe"
},
"osx": {
"MIMode": "lldb"
},
"linux": {
"miDebuggerPath": "/usr/bin/gdb"
},
"preLaunchTask": "build release",
}
]
}
这个问题甚至发生在一个小时前还在工作的示例模板上: https ://github.com/raysan5/raylib/tree/master/projects/VSCode/.vscode
解决方案
推荐阅读
- c - “ping.c:13:34:错误:函数调用的参数太多,预期单个参数 '__command',有 5 个参数”
- javascript - 如何计算动画期间的进度文本?
- javascript - 我想将字符串(包含浮点值数组)转换为 JAVASCRIPT 中的浮点数组
- microsoft-graph-api - 将纯文本文件上传到 OneDrive 后驱动器项目大小错误
- c# - 如何改变开关的颜色?
- vuejs2 - 如何更改 vue-good-table 中选定的行标签区域
- java - 不调用模拟函数,而是使用真实函数
- python - 在 Python 中按名称获取 Windows 进程的使用磁盘
- html - 如何将大屏幕图像下的 figcaption 位置更改为移动图像右侧?
- vb.net - 添加新控件后,以前添加到窗体的控件的位置在 Designer.vb 中重新组织