简体   繁体   English

如何在vs代码中编译c++?

[英]How to compile c++ in vs code?

Hi I'm a beginner at c++, I was trying to compile some code in vs code and I got this error: 'g++' is not recognized as an internal or external command, operable program or batch file.嗨,我是 c++ 的初学者,我试图在 vs 代码中编译一些代码,但出现此错误:'g++' 不被识别为内部或外部命令、可运行程序或批处理文件。 I'm just wondering how to fix this, whenever I try to compile in the command line I get a similar error?我只是想知道如何解决这个问题,每当我尝试在命令行中编译时都会遇到类似的错误?

First, you need to install a compiler(MinGW).首先,您需要安装一个编译器(MinGW)。

Now RightClick on My Computer
goto Advanced System Settings 
Environment Variables
now there in system variable goto path
in that add the file location of MinGW\bin folder
save it and restart VScode

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM