How to Install Microsoft Visual Studio Code for C++ Coding

About

Computer Engineering and Science students may need a code editor for their coursework.  For windows users, you can follow these steps to prepare your VS Code environment for C++ coding.

Environment

Windows

Steps

  • Go to code.visualstudio.com and click Download. It will detect the build for your environment.  It will download the .exe file.

code.visualstudio.com website with download for windows highlighted.

  • You can click the .exe. Do not adjust the destination location.  For additional tasks, you can create a desktop icon for ease of use.
  • Now, you will need a C++ compiler.  It is recommended that you use MinGW. Click Download to get the installer.
  • Click on the .exe file downloaded.
  • This will open the installer and click "Install"
  • Click Continue 
  • Click Continue Highlighted on the installer
  • Click continue again if needed 
  • You'll be prompted to choose which packages to install. In this case, you'll need g++ to run .cpp files.  It's recommended to choose base as well.
  • Then, click Installation and Apply Changes 
  • Then, click Apply.           
  • Now, go to your search bar at the bottom of the screen, and type in This PC. 
  • Then, click Local Disk on the left side, and MinGW from the available folders. 
  • Click bin                         Click folder bin
  • Right click on the navigator bar, and click copy address. 
  • Now, you can go to the search bar, type in environment variables and click environment variables. 
  • Click Environment Variables Uploaded Image (Thumbnail)
  • Then, click Path and Edit under system variables.Click Path and Edit in System Variables
  • Click new, paste the address we copied. Then, click Ok                              
  • Open VS Code, and go to explorer. Click Open Folder.  
  • Right click in the white space, click new, then folder and name your folder. Then, click select folder. 
  • Go to extensions, find the C++ extension and install it
  • Now, you can run a .cpp program. Go to explorer, and click ctrl+n to open a new file.  Name it with your chosen file name, and the extension .cpp                               
  •  
  •  
Was this helpful?
0 reviews