Article ID: 000058917 Content Type: Install & Setup Last Reviewed: 07/20/2021

Unable to Build a Custom Intel® Software Guard Extensions (Intel® SGX) Application in Visual Studio*

Environment

Visual Studio* 2019

Windows_10, windows1032bit, windows1064bit

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Four options to configure an Intel® Software Guard Extensions (Intel® SGX) project in Visual Studio*

Description
  • 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.
Resolution

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.

  1. 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*.
  2. Open Visual Studio and create a new Project.
  3. In the Search for templates box, search for SGX and select the Intel® SGX Enclave Project template.
  4. 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.

  1. 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.
  2. Open the Project Properties for the Source and for the Target so that you can see them side-by-side.
  3. Copy all of the properties from the Source to the Target.
  4. At the top of the Property Pages window, select Configuration: Simulation, Platform: x64 (or other desired configuration).
  5. 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.

Related Products

This article applies to 2 products