

Click the file icon in the top-right corner of the screen.Click the settings icon at the bottom left corner of the screen.If you’re not fond of keyboard shortcuts, consider using the method below instead: Please note that there are two settings.json files-one for the user settings and another for the workspace settings. Type “Settings.json” in the search bar and select the specific settings.json file you want to edit.Open VS Code and press the “Ctrl + Shift + P” shortcut to access the Command Palette.The February 2021 update of the Visual Studio Code C++ extension is now available! This latest release provides support for cross-compilation IntelliSense configurations and over 60 bug fixes! To find out more about all the enhancements, check out our release notes on GitHub. Cross-compilation IntelliSense configurations With this latest release, you can configure the extension to provide proper IntelliSense when compiling for a different platform than your host OS. That’s right- platform, not just architecture. The C++ extension no longer hardcodes system defines based on your host OS it’ll use the system defines returned by your compiler. Let’s say you’re developing on macOS and your project targets Linux. Assuming you have a compiler compatible with your project’s target platform and architecture, the C++ extension will query that compiler using the Compiler path, Compiler arguments, and IntelliSense mode settings in your IntelliSense configuration. If you’re using a custom configuration provider (like CMake Tools) or compile_commands.json, then you don’t need to worry about updating the C++ extension’s IntelliSense configuration everything should just work. Your project’s IntelliSense configurations are stored in the c_cpp_properties.json file under the. Under your configuration’s Compiler path setting, enter the path to the compiler compatible with your target platform and architecture.Įdit these settings by selecting C/C++: Edit Configurations (UI) from the Command Palette. Then use Compiler arguments to provide the target triplet that you use when cross-compiling your code with your compiler. For example, –target=x86_64-linux if you’re targeting Linux 64-bit. This allows the C++ extension to query the compiler for system defines and include paths specific to your target platform and architecture. Next, set IntelliSense mode to the platform- and architecture-specific variant of the compiler you’re using (it should closely match the target triplet defined in Compiler arguments).


If the information returned from querying the compiler doesn’t match the IntelliSense mode you chose, the C++ extension will automatically correct the IntelliSense mode for you.
