


OK, let’s save the latest version of tasks. Here is a version you can copy and paste. You don’t have to but if you plan to edit some C++ code in VS Code I would recommend installing the C/C++ for Visual Studio Code extension.If, for any good or bad reason, you don’t want to install Visual Studio but only the minimum set of tools you can install the Build Tools for Visual Studio 19 for example.Select the Extensions view icon on the Activity bar or use the keyboard shortcut (X (Windows, Linux Ctrl+Shift+X)). I mean you can compile some C++ project with Visual Studio 2017. C/C++ support for Visual Studio Code is provided by a Microsoft C/C++ extension to enable cross-platform C and C++ development on Windows, Linux, and macOS. Click the create a launch.json file link. Visual Studio 2017 (15.6.2) is installed and at least the C++ load is up and running.Open the Debug view on Windows or Linux by pressing Ctrl+Shift+D.OK, let’s start with the software settings: Fundamentally the steps explained here should be similar if you use another compiler. The current editor mode is indicated in the editor's Status Bar. When in the JSON with Comments mode, you can use single line (//) as well as block comments (/ /) as used in JavaScript. This mode is used for the VS Code configuration files such as settings.json, tasks.json, or launch.json.

Open up the Visual Studio Code keybindings. In addition to the default JSON mode following the JSON specification, VS Code also has a JSON with Comments (jsonc) mode. As you will see the compiler and the linker, I will use are the ones coming with Visual Studio 2017. Before using shell launcher, a key binding needs to be created to engage the shell launcher. At this time, I use VSCode 1.55.2 and cl version 3īonjour, this is a step-by-step procedure which explains how to compile C++ code with VS Code (aka Visual Studio Code). Note: I updated the article in April 2021.
