| Order | 9 |
|---|---|
| Area | languages |
| TOCTitle | C++ |
| ContentId | D06C8C5C-2D3A-4B2E-B31F-12F1907E6402 |
| PageTitle | C++ programming with Visual Studio Code |
| DateApproved | 2/25/2020 |
| MetaDescription | Find out how to get the best out of Visual Studio Code and C++. |
| MetaSocialImage | images/cpp/languages_cpp.png |
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.
The C/C++ extension does not include a C++ compiler or debugger. You will need to install these tools or use those already installed on your computer.
Popular C++ compilers are:
- GCC on Linux
- GCC via Mingw-w64 on Windows
- Microsoft C++ compiler on Windows
- Clang for XCode on macOS
Make sure your compiler executable is in your platform path so the extension can find it. You can check availability of your C++ tools by opening the Integrated Terminal (kb(workbench.action.terminal.toggleTerminal)) in VS Code and try running the executable (for example g++ --help).
- Open VS Code.
- Click the Extensions view icon on the Sidebar (
kb(workbench.view.extensions)). - Search for
c++. - Click Install.
Get started with C++ and VS Code with Hello World tutorials for your environment:
- GCC on Windows
- Microsoft C++ on Windows
- GCC on Linux
- GCC on Windows Subsystem For Linux
- Clang/LLVM on macOS
You can find more documentation on using the Microsoft C/C++ extension under the C++ section, where you'll find topics on:
VS Code and the C++ extension support Remote Development allowing you to work over SSH on a remote machine or VM, inside a Docker container, or in the Windows Subsystem for Linux (WSL).
To install support for Remote Development:
- Install the VS Code Remote Development Extension Pack.
- If the remote source files are hosted in WSL, use the Remote - WSL extension.
- If you are connecting to a remote machine with SSH, use the Remote - SSH extension.
- If the remote source files are hosted in a container (for example, Docker), use the Remote - Containers extension.
If you run into any issues or have suggestions for the Microsoft C/C++ extension, please file issues and suggestions on GitHub. If you haven't already provided feedback, please take this quick survey to help shape this extension for your needs.
