c++ - vsCode c++ minGW no such file or directory 错误
问题描述
我是第一次学习 c++ 并遵循https://code.visualstudio.com/docs/cpp/config-mingw上的指南,但我仍然无法成功编译和运行基本程序。这是我的配置、启动和任务文件。我认为可能发生的唯一问题是我的 E: 驱动器中有代码。虽然我不认为这应该是一个问题。任何和所有的帮助表示赞赏。
配置:
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\MinGW\\bin\\gcc.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "gcc-x64"
}
],
"version": 4
}
发射:
{
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/helloworld.exe",
"args": [],
"stopAtEntry": true,
"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
}
]
}
]
}
任务:
{
"version": "2.0.0",
"tasks": [
{
"label": "build hello world",
"type": "shell",
"command": "gcc",
"args": [
"-g",
"-o",
"helloworld",
".vscode"
"helloworld.cpp"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
输出是:
> Executing task: gcc -g -o helloworld .vscode helloworld.cpp <
gcc.exe: error: helloworld.cpp: No such file or directory
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
解决方案
推荐阅读
- ios - Objective-C:以编程方式在 Instagram 直接消息或提要中共享文本
- ruby-on-rails - 在设计中使用 ajax 表单时处理错误和闪烁消息
- node.js - 无法将 oracle db 与 nodejs 连接
- swift - Xcode 在执行下一个任务之前等待动画完成
- reactjs - 创建一个 React 组件库
- php - PHP Fatal error: Cannot use try without catch or finally
- javascript - 单击 cytoscape.js 中的节点时更改边缘颜色
- audio - Python 3.7 text-to-speech 只播放一个音频文件,有时根本没有音频,使用 IDLE 编辑器
- c - 由于缓冲区溢出而覆盖
- javascript - Firebase Cloud 异步错误(函数返回未定义、预期的 Promise 或值)