Skip To Main Content
Support Knowledge Base

Unable to Run the SampleCommonLoader Sample from the Intel® Software Guard Extensions (Intel® SGX) SDK for Linux*

Content Type: Error Messages   |   Article ID: 000059237   |   Last Reviewed: 02/08/2022

Environment

Operating System

Linux*
Intel SGX SDK for Linux 2.13.103.1

Description

  1. Installed the Intel® Software Guard Extensions (Intel® SGX) SDK for Linux*
  2. Ran make in <SGXSDK>/SampleCode/SampleCommonLoader
  3. Received errors:
    • App/sample.cpp:36:10: fatal error: sgx_enclave_common.h: No such file or directory 36 | #include "sgx_enclave_common.h"
    • /usr/local/bin/ld: cannot find -lsgx_enclave_common

Resolution

  1. Copy sgx_encalve_common.h from the SGX SDK's include directory to the SampleCommonLoader's include directory:
    $cp <SGXSDK>/include/sgx_enclave_common.h <SGXSDK>/SampleCode/SampleCommonLoader/Include/
  1. Install the libsgx_enclave_common library:
    $sudo apt-get install libsgx-enclave-common
  2. If  /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so does not exist, run:
    $ sudo ln -s /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so.1 /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so
  3. Make and run the sample program:
    $make
    $./sample