Four options to configure an Intel® Software Guard Extensions (Intel® SGX) project in Visual Studio*
- Encountered several compilation or linker errors when building an Intel® Software Guard Extensions (Intel® SGX) application in Visual Studio*.
- Encountered several errors when attempting to run an Intel SGX application in Simulation mode.
Option 1
Set up the enclave project in Visual Studio* according to the instructions in the Setting up an Intel Software Guard Extensions Project section in the Intel SGX SDK Developer Reference Guide for Windows*. The guide is distributed with each Intel SGX SDK for Windows and is in the documents directory where you expanded the SGX SDK installer file.
Option 2
Create an enclave project using the SGX Enclave Project template.
- Install the SGX add-in for Visual Studio using these instructions to manually install the Visual Studio* 2019 add-in from the Intel® Software Guard Extensions (Intel® SGX) Software Development Kit (SDK) for Windows*.
- Open Visual Studio and create a new Project.
- In the Search for templates box, search for SGX and select the Intel® SGX Enclave Project template.
- This will add an Enclave project with all of the correct settings that you can use to create your solution.
Option 3
Make a copy of the SGX SDK/SampleEnclave directory and use that as the base for your new project.
Option 4
Copy the properties from the SGX SDK/SampleEnclave to your existing project.
- Open two instances of Visual Studio.
- SGX SDK/SampleEnclave - the Source, the known good configuration. Do not change these properties.
- YourProject - the Target, the project you want to change.
- Open the Project Properties for the Source and for the Target so that you can see them side-by-side.
- Copy all of the properties from the Source to the Target.
- At the top of the Property Pages window, select Configuration: Simulation, Platform: x64 (or other desired configuration).
- Ensure all settings are the same in all fields:
Configuration Properties |
- General
- Advanced
- Debugging
- VC++ Directories
- C/C++ | All Options
- Linker | All Options
- Build Events | Post-Build Event
- Check all other fields to ensure that they are the same.