Setting Up C++ In Visual Studio Code



Unreal Engine (UE) is designed to integrate smoothly with Visual Studio (VS), allowing you to make code changes quickly and easily in your projects and immediately see results upon compilation. Setting up VS to work with UE can help improve efficiency and the overall user experience for developers using UE.

In this document, we will cover the basics for setting up your Unreal Engine-to-Visual Studio workflow. While this document focuses on using the most recent versions of UE and VS, you can look at our Visual Studio Legacy Reference Page for help using older versions of UE and VS.

Learn how to configure Visual Studio Code for C development by installing an extension for autocomplete among other things as well as configuring tasks for.

  1. You can use the File Template extension. C files are not included in its default list of supported file types. But it does support adding your own templates for known VS Code language identifiers, such as.cpp for C files. To set it up, follow the instructions on the extension's page.
  2. There is a much easier way to compile and run C code, no configuration needed: Install the Code Runner Extension; Open your C code file in Text Editor, then use shortcut Ctrl+Alt+N, or press F1 and then select/type Run Code, or right click the Text Editor and then click Run Code in context menu, the code will be compiled and run, and the output will be shown in the Output Window.

Vscode C++ Setup

Before Setting-up your Unreal Engine-to-Visual Studio Workflow

The following table lists which versions of VS are integrated with the binary version of UE.

Unreal Engine Version

Visual Studio Version

Setting Up C++ In Visual Studio Code

The following are recommended settings for developers using VS with UE.

If our version of VS looks a little different, it's because we have changed the theme to Dark. You can do this by going to Tools > Options > Environment > General > Color theme.

Increase the Width of Solution Configurations Dropdown Menu

  1. Right-click on the toolbar and select Customize at the bottom of the menu that appears.

  2. Click on the Commands tab and select the Toolbar radio button.

  3. In the dropdown next to the Toolbar, choose Standard.

  4. In the Preview list, select the Solution Configurations control (you may need to scroll down) and then click Modify Selection.

  5. Set the Width to 200. Then click OK.

  6. Click Close on the Customization . Your toolbar should update immediately.

Add the Solution Platforms Dropdown

  1. Locate the far right button on the Standard toolbar (if you hover the mouse over it, it's labeled Standard Toolbar Options).

  2. Click the dropdown button, choose Add or Remove Buttons, and then click on Solution Platforms to add the menu to the toolbar (this may be enabled by default).

Studio

Turn Off the Error List Window

Typically, the Error List window pops up automatically when you have an error in your code. However, when working with UE, the Error List window can display false error information. It's best to disable the Error List window, and use the Output window to see real code errors when working with UE. The following steps show you how to turn off the Error List window.

  1. Close the Error List window if it is open.

  2. From the Tools menu, open the Options dialog.

  3. Select Projects and Solutions and disable Always show Error List if build finishes with error.

  4. Click OK.

Here are some other configuration settings you may find useful:

  • Turn off Show Inactive Blocks. If you don't, many chunks of code may appear grayed out in the text editor. Go to Tools > Options > Text Editor > C/C++ > View to turn off this setting

  • Set Disable External Dependencies Folders to True to hide unneeded folders in the Solution Explorer. Find Disable External Dependencies Folder in Tools > Options > Text Editor > C/C++ > Advanced.

  • Turn off Edit & Continue features, you do not need them. Go to Tools > Options > Debugging > Edit and Continue.

  • Turn on IntelliSense.

Debugging

For more information about Debug Support, check out the debugging section of our Visual Studio Legacy Page.