A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://code.visualstudio.com/docs/cpp/configure-intellisense-crosscompilation below:

IntelliSense for cross-compiling

IntelliSense for cross-compiling

This article is about configuring the C/C++ extension to provide proper IntelliSense (e.g. code completions) in Visual Studio Code when you compile for a different architecture than your development host machine. For example, when your host machine is x64 but you are compiling for Arm.

The C/C++ extension isn't a compiler -- it provides rich language features such as syntax highlighting and IntelliSense. For the extension to provide correct IntelliSense suggestions and to reflect the right sizes of data types, you need to configure the C++ extension to emulate the target architecture.

These configuration settings are stored in your project's c_cpp_properties.json file. To edit this file, in VS Code, select C/C++: Edit Configurations (UI) from the Command Palette (⇧⌘P (Windows, Linux Ctrl+Shift+P)):

Example IntelliSense configuration

The following shows configuring the C/C++ extension for a Linux x64 host machine that targets Linux Arm. It configures the following IntelliSense settings:

At a minimum, setting compiler path and IntelliSense mode provides enough information for the extension to emulate your project's target architecture, although setting IntelliSense mode may not be needed if the extension is able to choose it correctly based on the defines returned from querying the compiler path.

Compiler path

Set to the full path of the compiler you are using to build your project.

For example:

IntelliSense mode

Set to the architecture-specific variant of the compiler you are using.

For example:

Include path

You only need to modify the Include path if your program includes header files that aren't in your workspace or that are not in the standard library path.

The C/C++ extension populates the include path by querying the compiler specified by Compiler path. If the extension can't find the path for the target system libraries, you can enter the include path manually:

Given the settings above, your c_cpp_configuration.json file will look something like the following. You can open it by selecting C/C++: Edit Configurations (JSON) from the Command Palette:

{
  "configurations": [
    {
      "name": "myConfigurationName",
      "includePath": ["${workspaceFolder}/**"],
      "defines": [],
      "compilerPath": "/usr/bin/arm-none-eabi-g++",
      "cStandard": "c11",
      "cppStandard": "c++14",
      "IntelliSenseMode": "gcc-arm"
    }
  ],
  "version": 4
}
Next steps

1/17/2023


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4