简体   繁体   English

当我运行我的代码时,VScode 上的 C++ 不起作用

[英]C++ on VScode is not working when I run my code

So, I just recently started learning C++ and my cousin said that a good IDE was VScode.所以,我最近才开始学习 C++,我表弟说一个好的 IDE 是 VScode。 So, I installed VScode, downloaded the extensions that supported C++, and wrote my programs and got this:所以,我安装了 VScode,下载了支持 C++ 的扩展,并编写了我的程序并得到了这个:

"g++" is not recognized as an internal or external command.

what do I do here?我在这里做什么? I have looked at other questions that ask the same questions, but all of them mainly say to download a compiler like MinGW (Which I already have) and CygWin (also have downloaded this one).我看过其他提出相同问题的问题,但他们都主要说要下载像 MinGW(我已经拥有)和 CygWin(也已经下载了这个)这样的编译器。 So what do I do?那我该怎么办?

Based on the OS, you need to add path to g++ to PATH variable.根据操作系统,您需要将 g++ 的路径添加到 PATH 变量中。 Check ~/.profile file?检查 ~/.profile 文件?

Also check: https://github.com/microsoft/vscode-cmake-tools/issues/576还要检查: https://github.com/microsoft/vscode-cmake-tools/issues/576

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 vscode:c/c++ 扩展:运行代码不工作 - vscode: c/c++ extension: run code not working 我无法在 VSCode 中调试我的 C++ 代码 - I'm Unable to debug my C++ code in VSCode 如何授予对 vscode 的正确访问权限,以便在我运行 c++ 代码时它不会每次都要求访问文档? - How to grant the proper access to vscode so that when I run c++ code it doesn't ask for document access every time? 当我在代码中使用“字符串”命令时,NetBeans C ++将建立但不会运行(退出值127) - NetBeans C++ will BUILD but not RUN (exit value 127) when I use a “string” command in my code 为什么c++代码运行时会新建一个exe文件是vscode,为什么这么大? - Why does c++ code create a new exe file when it is run isn vscode and why is it so big? 我的C ++代码无法正常工作 - My Code of C++ is not Working 如何在 Heroku 中运行我的 C++ 代码? - How do I run my C++ code in Heroku? 当我在 cmd 或 VScode 上运行时,C++ 程序不输出(但在 repl.it 上确实如此) - C++ program doesn't output when I run on cmd or VScode (but on repl.it it does) 如何在调试 C++ 代码时告诉 VSCode 加载我的共享 dll? - How do I tell VSCode to load my shared dlls upon debugging c++ code? VSCode 语法错误突出显示不适用于 C++ 代码 - VSCode syntax error highlighting is not working for C++ code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM