【发布时间】:2020-10-06 22:07:51
【问题描述】:
根据以下链接,我安装并执行了示例 CPP 程序。但我有一个错误:
https://code.visualstudio.com/docs/cpp/config-mingw
Tasks.json
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: g++.exe build active file",
"command": "C:\\Program Files (x86)\\mingw-w64\\i686-8.1.0-posix-dwarf-rt_v6-rev0\\mingw32\\bin\\g++.exe",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}\\${fileBasenameNoExtension}.exe"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
PS F:\VS_Code\projects\cpp\helloworld> helloworld.exe helloworld.exe:术语“helloworld.exe”不被识别为 cmdlet、函数、脚本文件或可运行程序的名称。 检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。 在 line:1 char:1
- helloworld.exe
-
+ CategoryInfo : ObjectNotFound: (helloworld.exe:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
建议[3,General]:没有找到命令helloworld.exe,但在当前位置确实存在。默认情况下,Windows PowerShell 不会从当前位置加载命令。如果您信任此命令,请键入:“.\helloworld.exe”。有关详细信息,请参阅“get-help about_Command_Precedence”
【问题讨论】: