Developer Guide

Intel oneAPI DPC++/C++ Compiler Handbook for Intel FPGAs

ID 785441
Date 5/08/2024
Public
Document Table of Contents

Enable Code Completion in a Visual Studio* Code Project

To enable code completion from the Intel® oneAPI header files in Visual Studio* Code, you must enable code completion individually for each oneAPI project in Visual Studio* as follows:

  1. Follow the steps in Set the Environment Variables and Launch Visual Studio* Code to launch VS Code* with the required oneAPI environment.
  2. Open the project that you want to enable code completion for.
  3. Open the VS Code* command palette (View > Command Palette) and search for C/C++: Edit Configurations (JSON)
  4. In the c_cpp_properties.json file, make the following configuration the only configuration in the file:
    Linux* VS Code* Configuration
    {
      "name": "oneaAPI 2024.1",
      "includePath": [
       "${default}",
       "${workspaceFolder}/**",
       "${env:INTELFPGAOCLSDKROOT}/../../include/**",
       "${env:INTELFPGAOCLSDKROOT}/../../opt/oclfpga/include/**"
      ],
      "defines": [
       "_DEBUG",
       "UNICODE",
       "_UNICODE"
      ],
      "cStandard": "c17",
      "intelliSenseMode": "linux-clang-x64",
      "compilerPath": "${env:INTELFPGAOCLSDKROOT}/../../bin/icpx",
      "cppStandard": "c++17"
    }
    Windows* VS Code* Configuration
    {
      "name": "oneaAPI 2024.1",
      "includePath": [
       "${default}",
       "${workspaceFolder}/**",
       "${env:INTELFPGAOCLSDKROOT}/../../include/**",
       "${env:INTELFPGAOCLSDKROOT}/../../opt/oclfpga/include/**"
      ],
      "defines": [
       "_DEBUG",
       "UNICODE",
       "_UNICODE"
      ],
      "cStandard": "c17",
      "intelliSenseMode": "windows-clang-x64",
      "compilerPath": "${env:INTELFPGAOCLSDKROOT}/../../bin/icpx.exe",
      "cppStandard": "c++17"
    }
  5. Save your configuration changes and close the c_cpp_properties.json file.