Get Started with the Intel® oneAPI Base Toolkit for Windows*

ID 766891
Date 6/30/2025
Public

Build and Run a Sample Using Visual Studio*

Intel® oneAPI integrates with third-party IDEs on Windows* to provide a seamless GUI experience for software development.

You can use the Intel® oneAPI DPC++/C++ Compiler within the Microsoft Visual Studio* integrated development environment (IDE) to develop C++ applications, including static library (.LIB), dynamic link library (.DLL), and main executable (.EXE) applications. This environment makes it easy to create, debug, and execute programs. You can build your source code into several types of programs and libraries using the IDE or from the command line.

Define the SETVARS_CONFIG Environment Variable

The SETVARS_CONFIG environment variable is not automatically defined during installation, you must add it to your environment before starting Visual Studio using the following. This only needs to be set once.

  1. Open a command window.
  2. Set system variables for Visual Studio:
     setx SETVARS_CONFIG " "

Create a Project Using Microsoft Visual Studio*

Watch a video guide on creating a sample project with Intel® oneAPI Visual Studio Samples Browser.

  1. Open Microsoft Visual Studio*.
  2. For Visual Studio 2019 and 2022, a page showing recent projects may display. Click Continue without code.
    NOTE:
    In the next step, you will look for a menu named Extensions > Intel or Intel. If you do not see either of these menu choices, then the plug-ins have not been installed. See Troubleshooting to fix the plug-ins.
  3. From the top menu, select:
    • Visual Studio 2019 and 2022: Extensions > Intel > Browse an Intel oneAPI Sample

    The samples screen will open:

  4. In the center area, select Vector Add. Vector Add is a simple test application that helps verify that the tools are setup correctly and can access your system's GPU.
  5. Click OK.
  6. From the Solution Explorer, right-click on vector-add and select Rebuild.
  7. After the program is built, click Debug > Start Without Debugging. The results will display:

See Explore SYCL Through Samples to learn more.