Posts How setup VScode
Post
Cancel

How setup VScode

A Guide on how to setup VScode and Code Runner for C++ 17 (Mac/Windows)

Step1. Download VScode and exteentions.

  1. Download and install Vscode and from the microsoft website https://code.visualstudio.com/download.

  2. Open VScode.

  3. Download and install C++ Extensions for VScode.

  4. Download and install Code Runner Extension.

Step 2. Set up Code Runner with C++17 flag

  1. Go to Code / Prefrences / Settings then Select Extensions -> Run Code Configure -> Executor Map

  2. Add the following command to run for cpp file in the Executor map.

    1
    2
    3
    
     "code-runner.executorMap": {
         "cpp": "cd $dir && g++ -std=c++17 -g $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt"
     }
    
  3. Now create a test file test.cpp and run the file using Code Runner Play button. You can see the excuted Command and Outuput in the terminal Window.

Similarly you can set up which commands to execute for different languages. Here is a link to a blog to help you with it.

Thank You

This post is licensed under CC BY 4.0 by the author.