How to set up C++ in Visual Studio Code

How to set up C++ with Visual Studio Code (vscode). Install Visual Studio Code: https://code.visualstudio.com/ Install minGW (C++ Compiler): https://code.v...

How to set up C++ in Visual Studio Code
Kenny Yip Coding
2.1M views โ€ข Oct 13, 2023
How to set up C++ in Visual Studio Code

About this video

How to set up C++ with Visual Studio Code (vscode).

Install Visual Studio Code: https://code.visualstudio.com/

Install minGW (C++ Compiler): https://code.visualstudio.com/docs/cpp/config-mingw

Steps to setup minGW in windows:
1. Install MSYS2 using the link provided by microsoft https://github.com/msys2/msys2-installer/releases/download/2023-05-26/msys2-x86_64-20230526.exe

2. Open MSYS2, enter the follow command:
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchain

3. Hit Enter for default selection, then type Y and hit Enter to proceed with the installation.

4. In your search bar, look for edit Environment Variables and open the setting. In the window bottom right, click Environment Variables. Click on Path in your list of User Variables. Click edit, new, add the following:

C:\msys64\ucrt64\bin

5. In your seach bar, look for Command Prompt and open it. Type in gcc --version, g++ --version, and gdb -- version. You should see minGW setup correctly.

Open vscode, and in extensions, look for C/C++ Extension Pack and install it. Then, create a new text file. Name it whatever you want, but be sure to include the .cpp extension.

Ex) Create a file named test.cpp and add some starter code. (include iostream, using namespace std, int main() ... cout "Hello World!")

On the top right, click on the play button to run your program. Select Run C/C++ File. You should now see your output display in the built-in terminal of VS Code!

And, there you have it! How to setup C++ for Visual Studio Code!

C++ Programming Playlist:
https://www.youtube.com/playlist?list=PLnKe36F30Y4ZDNIOZ51sX25pWKQ1pkpTE

Java Game Programming Projects Playlist:
https://www.youtube.com/playlist?list=PLnKe36F30Y4Y1XQOqNsL9Fgg_p6nYhcng

JavaScript Game Programming Projects Playlist:
https://www.youtube.com/playlist?list=PLnKe36F30Y4bLhA-st9sC4ZthyV7nsL2Q

Subscribe for more coding tutorials ๐Ÿ˜„!

โญ If you enjoyed the tutorial and would like to support the channel, you can do so here ๐Ÿ’–: https://buymeacoffee.com/kennyyipcoding

Tags and Topics

Browse our collection to discover more content in these categories.

Video Information

Views

2.1M

Likes

29.0K

Duration

6:53

Published

Oct 13, 2023

User Reviews

4.7
(412)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.

Trending Now