How to Run C++ in Visual Studio Code on Windows 10 2022 Best IDE

Tech Decode Tutorials · 1.1M views · 2020 · 9:06

Open on YouTube

Testing, debugging & developer toolsC, C++, Rust, Go & systems languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as a setup walkthrough for running C++ in VS Code with MinGW, and askers also cite it as the guide they followed before hitting errors.

Recommended by 2 people across 2 different months, 2021 to 2022.

What it is

A 9-minute beginner tutorial from Tech Decode Tutorials showing how to set up C and C++ development in Visual Studio Code on Windows 10. It covers installing the MinGW compiler, setting the g++/gcc PATH, installing VS Code with the Code Runner and C/C++ extensions, and running a sample program that reads user input.

What people said

Recommends Aak · 2021-05 · Stack Overflow · on “Installed VS code, there is no builder to build my code, even though I installed MinGW-w64”

I looked around and found this YouTube video- [this video] . You can take a look at it to run the program directly without using terminal

Recommends user16645195 · 2021-09 · Stack Overflow · on “My simple code isn't working and it gives me an error”

I thing you have installed before Mingw , so 99% the problem, is this: add the PATH to your bin folder in Environment Variable. 1. open folder [LINK] 2. click this pc (folder) [LINK] 3. Click mingw folder [LINK] 4. click Bin folder [LINK] 5. now to copy the path from the top [LINK] C:\MinGW\bin 6. go another time to MY PC folder [LINK] 7. now click in the FREE SPACE with your right-click-mouse [LINK] what is mean right-click ? ok. [LINK] 8. click properties [LINK] now you have a UI like this: [LINK] 9. click Advanced system settings [LINK] 10. click on Environment variable [LINK] now the UI is like this: [LINK] 11. click on Path , the Click Edit... [LINK] now the UI is like this: [LINK] 12.

Cites Usman Shabbir · 2021-09 · Stack Overflow · on “g++: error: First: No such file or directory (running c++ on VScode 2021)”

I installed MinGW and also updated path in environment variables. Also installed two extension on VScode 1) .codeRunner 2) c/c++ after this setup, i created a c++ file with name "firstprogram.cpp" in a folder and now this shows these error lines. [Running] cd "f:\c++\" && g++ "First Program.cpp" -o First Program && "f:\c++\"First Program g++: error: First: No such file or directory g++: error: Program.cpp: No such file or directory g++: error: Program: No such file or directory g++: fatal error: no input files compilation terminated. => i'm using window10 although i followed this video from start to end: [this video]

Cites user2988694 · 2022-04 · Stack Overflow · on “VS Code :: C++ :: Error with giving inputs to the program”

I have just setup the VS Code to run C++ using the YouTube video [this video] Now when I write a simple code #include <iostream> using namespace std; int main() { cout << "Enter your first name:"; cin << first_name; cout << "Your name is" + first_name; return 0; } I keep getting the error PS C:\Users\raman\OneDrive\Documents\C++_Projects> cd "c:\Users\raman\OneDrive\Documents\C++_Projects\" ; if ($?) { g++ Input.cpp -o Input } ; if ($?) { .\Input }Input.cpp: In function 'int main()': Input.cpp:8:18: error: 'first_name' was not declared in this scope 8 | cin << first_name;