Intel® Software Guard Extensions (Intel® SGX)
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.
1265 Discussions

Intel SGX, SampleCommonLoader sample code error sgx_enclave_common.h: No such file or directory

donaldi95
Novice
422 Views

I wanted also to ask about an error i get.

 

It Is because of a library called sgx_enclave_common.h.

When i run the SampleCommonLoader code sample in HW mode, it gives me the following error:

App/sample.cpp:36:10: fatal error: sgx_enclave_common.h: No such file or directory 36 | #include "sgx_enclave_common.h"

Any idea on what should i do?

PS: I am following the SGX tutorial for Linux 20.04. My laptop had I7-8U generation. SGX is enabled, but it doesn't support DCAP.

Best Regards, Donald

0 Kudos
1 Solution
JesusG_Intel
Moderator
413 Views

Hello Donald,


Copy sgx_enclave_common.h from <sgxsdk>/include/ to <sgxsdk>/SampleCode/SampleCommonLoader/Include/


Sincerely,

Jesus G.

Intel Customer Support


View solution in original post

5 Replies
JesusG_Intel
Moderator
414 Views

Hello Donald,


Copy sgx_enclave_common.h from <sgxsdk>/include/ to <sgxsdk>/SampleCode/SampleCommonLoader/Include/


Sincerely,

Jesus G.

Intel Customer Support


donaldi95
Novice
403 Views

 Hello Jesus G.

 

I did this and i run into an other error.

 

GEN => App/sample.o
GEN => App/enclave_entry.o
/usr/local/bin/ld: cannot find -lsgx_enclave_common
collect2: error: ld returned 1 exit status
make: *** [Makefile:35: sample] Error 1

 

I also did make clean, and when i make again same error.

I did GEN => App/sample.o
GEN => App/enclave_entry.o
/usr/local/bin/ld: cannot find -lsgx_enclave_common
collect2: error: ld returned 1 exit status
make: *** [Makefile:35: sample] Error 1


i also did again Source {sgxsdk}/environent. And nothing changed.

 

Best Regards,

Donald

JesusG_Intel
Moderator
393 Views

Hello Donald,


Check if /usr/lib/x86_64-linux-gnu/libsgx_enclave_common.so exists. If it 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


Run make again.


It seems that the SampleCommonLoader sample in the SGX SDK for Linux is buggy. It works fine in Windows.


Please open an issue in https://github.com/intel/linux-sgx/issues detailing these two problems. You will get the attention of the SGX engineering team in Github.


Sincerely,

Jesus G.

Intel Customer Support


donaldi95
Novice
388 Views

Hello Jesus G.

 

Thank you so much for your help it finally worked. I will report it on their git repo asap.

 

Best Regards,

Donald

JesusG_Intel
Moderator
375 Views

This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.


Reply