首页 > 解决方案 > 如何使用 mingw 使 g++ 命令在 VSCode 中工作

问题描述

我正在尝试设置 Visual Studio Code 以使用 C++ 和 Mingw。我正在使用教程https://code.visualstudio.com/docs/cpp/config-mingw。当我按照教程中所述使用 ctrl+shift+b 构建 helloworld.cpp 时,我收到错误消息:

> Executing task: g++ -g -o helloworld helloworld.cpp <

g++ : The term 'g++' is not recognized as the name of a cmdlet, function, 
script file, or operable program. Check the spelling of the name
, or if a path was included, verify that the path is correct and try 
again.
At line:1 char:1
+ g++ -g -o helloworld helloworld.cpp
+ ~~~
+ CategoryInfo          : ObjectNotFound: (g++:String) [], 
CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

问题可能出在哪里?我是否错误地配置了 bash?

标签: c++jsonvisual-studio-code

解决方案


推荐阅读