I run my C++ code on Visual Studio Code with the file extension .cpp but it’s not working. How can I run this on Visual Studio Code without using mingw? Is there any extension which can help me to run this code on Visual Studio Code?
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
Visual studio code is just an IDE. With the Microsoft C/C++ Extension (https://code.visualstudio.com/docs/languages/cpp) it can do all the syntax checking / highlighting / IntelliSense / etc. But it does not have an in-built compiler. It relies on having suitable compiler / linker installed already.
So, you need to install something like mingw, etc. See https://code.visualstudio.com/docs/languages/cpp#_install-a-compiler.
Without a compiler like mingw (or another gcc variant), you can’t really compile or run c++ code. You maybe need to check the setup about installing gcc or clang in your environment.
What You Can Do: