Article ID: 000057417 Content Type: Error Messages Last Reviewed: 08/06/2021

Encountered Linker, "ld," Errors when Trying to Compile Intel® Software Guard Extensions (Intel® SGX) SDK Samples

Environment

Linux*

BUILT IN - ARTICLE INTRO SECOND COMPONENT
Summary

Quick step to set environment variables before compiling and running Intel® Software Guard Extensions (Intel® SGX) applications

Description

The sample code in the Intel® Software Guard Extensions (Intel® SGX) SDK does not compile, even after installing the SDK at /opt/intel/sgxsdk.

Error:

/usr/bin/ld: warning: libsgx_uae_service_sim.so, needed by /opt/intel/sgxsdk/lib64/libsgx_urts_sim.so, not found
(try using -rpath or -rpath-link)
/opt/intel/sgxsdk/lib64/libsgx_urts_sim.so: undefined reference to `get_launch_token'
collect2: error: ld returned 1 exit status
Makefile:235: recipe for target 'app' failed
make[1]: * [app]
Error 1 make[1]: Leaving directory '/opt/intel/sgxsdk/SampleCode/SampleEnclave'
Makefile:180: recipe for target 'all' failed make: * [all] Error 2

Resolution

Before compiling or running an Intel® Software Guard Extensions (Intel® SGX) application, source the Intel SGX SDK environment file to set the correct paths to the Intel SGX libraries that are required to compile and link enclaves:

$source /opt/intel/sgxsdk/environment

Related Products

This article applies to 1 products