Text of code.visualstudio.com › docs › cpp › customize-cpp-settings as Styx crawled it on Oct 9, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

C++ extension settings reference

AI agents: See llms.txt for documentation discovery and navigation. Documentation articles are also available as Markdown by appending .md to the article URL. 🎬 Watch The Story of VS Code! VS Code is now on Instagram, follow @vscode.ig for updates, tips, and more. Rewatch GitHub Copilot Day. C++ extension settings reference View as Markdown Ask in VS Code Ask in VS Code Insiders The C++ extension settings are highly configurable.

This article explains the schema for the c_cpp_properties.json file. For general information about settings in VS Code, refer to Configure settings , as well as the Variables reference and Default VS Code Settings . Looking to get started with configuring your C++ project? Begin with configure Intellisense . Example of variables The following JSON snippet is an example configuration for c_cpp_properties.json . You only need to include relevant variables in your JSON file, and any missing fields are filled in with their default values by the C++ extension. { "env" : { "myIncludePath" : [ "${workspaceFolder}/include" , "${workspaceFolder}/src" ], "myDefines" : [ "DEBUG" , "MY_FEATURE=1" ] }, "configurations" : [ { "name" : "Mac" , "compilerPath" : "/usr/bin/clang++" , "intelliSenseMode" : "macos-clang-x64" , "includePath" : [ "${myIncludePath}" , "${workspaceFolder}/**" ], "defines" : [ "${myDefines}" ], "cStandard" : "c17" , "cppStandard" : "c++20" , "macFrameworkPath" : [ "/System/Library/Frameworks" , "/Library/Frameworks" ], "browse" : { "path" : [ "${myIncludePath}" , "${workspaceFolder}" ] } } ], "version" : 4 , "enableConfigurationSquiggles" : true } Top-level properties env : An array of user-defined variables that are available for substitution in the configurations via the standard environment variable syntax: ${<var>} or ${env:<var>} .

Strings and arrays of strings are accepted. configurations : An array of configuration objects that provide the IntelliSense engine with information about your project and your preferences. By default, the extension creates a configuration for you based on your operating system. You can also add more configurations. version : We recommend that you don't edit this field. It tracks the current version of the c_cpp_properties.json file, so that the extension knows what properties and settings should be present and how to upgrade this file to the latest version. enableConfigurationSquiggles : Set to true to report errors detected in the c_cpp_properties.json file to the C++ extension.

Configuration properties name : A user-friendly name that identifies a configuration. Linux , Mac , and Win32 are special identifiers for configurations that are autoselected on those platforms. The Status Bar in VS Code shows you which configuration is active. You can also select the label in the Status Bar to change the active configuration. compilerPath : The full path to the compiler you use to build your project, for example /usr/bin/gcc , to enable more accurate IntelliSense.

The extension queries the compiler to determine the system include paths and default defines to use for IntelliSense. Putting "compilerPath": "" (empty string) skips querying a compiler. This is useful if your preferred compiler doesn't support the arguments that are used for the query, as the extension defaults to any supported compilers it can find (like MSVC). Leaving out the compilerPath property does not skip the query. compilerArgs : Compiler arguments to modify the includes paths or defines used, for example -nostdinc++ , -m32 , etc.

Arguments that take additional space-delimited arguments should be entered as separate arguments in the array, for example, for --sysroot <arg> use \"--sysroot\", \"<arg>\" . intelliSenseMode : The IntelliSense mode to use that maps to an architecture-specific variant of MSVC, gcc, or Clang. If not set or if set to ${default} , the extension chooses the default for that platform. Platform defaults: Windows: windows-msvc-x64 Linux: linux-gcc-x64 macOS: macos-clang-x64 IntelliSense modes that only specify <compiler>-<architecture> variants (for example, gcc-x64 ) are legacy modes and are automatically converted to the <platform>-<compiler>-<architecture> variants based on the host platform. includePath : An include path is a directory of header files that are included by a source file.

For example, a source file contains the include directive #include "myHeaderFile.h" , adding the path of this header file to the includePath . Specify a list of paths for the IntelliSense engine to use while searching for included header files. Searching on these paths is not recursive. Specify /** at the end of the path to indicate recursive search. For example, ${workspaceFolder}/** searches through all subdirectories while ${workspaceFolder} will not.

If you are on Windows with Visual Studio installed, or if a compiler is specified in the compilerPath setting, the system include paths should not be listed here. defines : A list of preprocessor definitions for the IntelliSense engine to use while parsing files. Optionally, use = to set a value, for example VERSION=1 . cStandard : The version of the C language standard to use for IntelliSense. For example, c17 , gnu23 , or ${default} .

Note: GNU standards are only used to query the set compiler to get GNU defines, and IntelliSense emulates the equivalent C standard version. cppStandard : The version of the C++ language standard to use for IntelliSense. For example, c++20 , gnu++23 , or ${default} . Note: GNU standards are only used to query the set compiler to get GNU defines, and IntelliSense emulates the equivalent C++ standard version. configurationProvider : The ID of a VS Code extension that can provide IntelliSense configuration information for source files.

For example, use the VS Code extension ID ms-vscode.cmake-tools to provide configuration information from the CMake Tools extension. If you specified a configurationProvider , the configuration it provides takes precedence over your other settings in c_cpp_properties.json . A configurationProvider candidate extension must implement vscode-cpptools-api . mergeConfigurations : Set to true to merge include paths, defines, and forced includes with those from a configuration provider. windowsSdkVersion : The version of the Windows SDK include path to use on Windows, for example 10.0.17134.0 . macFrameworkPath : A list of paths for the IntelliSense engine to use while searching for included headers from Mac frameworks. forcedInclude : A list of files that should be included before any text in the source file is processed.

Files are included in the order listed. compileCommands : An array of paths that contain the full path to the compile_commands.json file for the workspace. If there is a matching entry in compile_commands.json for a file open in the editor, that command line is used to configure IntelliSense for that file, instead of the other fields of c_cpp_properties.json . For more information about the file format, see the Clang documentation .

Some build systems, such as CMake, simplify generating this file . dotConfig : A path to a .config file, created by the Kconfig system. The Kconfig system generates a file with all the defines needed to build a project. Examples of projects that use the Kconfig system are the Linux Kernel and NuttX RTOS. customConfigurationVariables : Custom variables that can be queried through the command ${cpptools:activeConfigCustomVariable} to use for the input variables in launch.json or tasks.json . browse : The set of properties used in conjunction with IntelliSense to identify all symbols in your code base.

These properties are used by features such as Go to Definition/Declaration , global symbol search, or when the "default" IntelliSense engine is unable to resolve the #includes in your source files. recursiveIncludes : A set of properties used to configure how the extension processes an includePath entry that specifies a recursive search. Browse properties path : A

The rest of this page is on the live site.