How to Run C++ in Visual Studio Code on Windows 11 (2023 tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's see how to install Visual Studio code and set it up for C plus development on Windows 11. first we're going to download their compiler so let's open the web browser and let's head over to winlibs.com here you can download Ming GW for Windows so let's scroll down a bit and I'll go with the latest version but without all of the additional tools so without these ones so this is what I'm going to download and make sure that you go with the win64 version and not with the win32 so it's the second line and let's click here to download the zip archive okay so the zip file was downloaded let's now open the downloads folder to see it and here it is so let's extract the contents of this archive so let's right click on it and choose extract all I'll uncheck this box and extract and it contains quite a lot of files so it's going to take a few minutes okay so the contents were accepted and we now have everything in this folder now I don't want meaning GW to be inside my downloads folder so I'm going to move it directly to the C drive so let's cut it from here and move it to the C drive the next thing is going to be adding mink GW to the systems path so let's start the Windows start menu and look for environment and we need to click where it says edit the system environment variables and it opens this menu system properties and here we need to click again on environment variables and at the top we have the user variables and at the bottom the system variables both of them contain the path variable and in most cases it doesn't really matter which one you change this one requires less privileges so let's edit the path variable and we want to add a new entry to the system's path and now let's get back to the mink GW directory and here we have the bin subfolder let's open it and that's the folder we want to add to the system's path so let's copy the directories path from the address line and let's get back to our path environment variable so let's click on new and paste it as the new entry so this is done let's click on OK again and once more to make sure that we now have system-wide access to the C plus plus compiler let's open the windows terminal and let's run G plus plus dash dash version and we got some specific version which means that we now have access to g plus plus which is the C plus plus compiler we just downloaded let's close the windows terminal the next step is going to be installing Visual Studio code so let's open the web browser again and let's now head over to code.visualstudio.com and let's download for Windows and visual studio code is being downloaded okay so the installer was downloaded let's run it from the downloads folder and let's accept the agreement I'll go with the default installation folder and here I leave everything with its default settings and just click on next and let's install Visual Studio code great so it was installed let's launch it now inside Visual Studio code let's open the extensions tab and let's look for C plus plus we're going to download the first two options by Microsoft so C C plus plus this one and then C C plus plus extension pack this is also by Microsoft let's start with this one okay this was installed let's continue to the second one C C plus plus extension pack and let's install it as well great so both of the extensions were installed let's now open a folder that will serve as a workspace so fine and then open folder and I'm going to create a new folder for my C plus project and let's select this folder let's close the get started window and let's now create a new C plus source file I call it main.cpp and let's write a simple C plus program okay our program is ready let's save it by Ctrl s and let's now try to run it here we have the play button but as you can see it has a small icon of a bug next to it this is for debugging first I want to just run my program so I'll click on the small Arrow next to it and choose run c c plus Phi now since our compiler is included in the systems path it was recognized by Visual Studio code the Ming GW beam folder had a few executable options but we're going to go with the first one G plus plus dot exe so let's choose it and our program is being compiled and then it will be also run we need to switch the terminal tab and here we can see our program so we need to enter a name and you can see the expected result if we would like to debug the program and not just run it we could always add a breakpoint like so and then instead of running the program we could debug it
Info
Channel: Another barefoot eel
Views: 3,659
Rating: undefined out of 5
Keywords:
Id: lNe3QZTHRR8
Channel Id: undefined
Length: 6min 45sec (405 seconds)
Published: Thu Jan 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.