Intel® Software Guard Extensions (Intel® SGX)
Discussion board focused on hardware-based isolation and memory encryption to provide extended code protection in solutions.
1465 Discussions

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

donaldi95
Novice
1,686 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
1,677 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

0 Kudos
5 Replies
JesusG_Intel
Moderator
1,678 Views

Hello Donald,


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


Sincerely,

Jesus G.

Intel Customer Support


0 Kudos
donaldi95
Novice
1,667 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

0 Kudos
JesusG_Intel
Moderator
1,657 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
1,652 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

0 Kudos
JesusG_Intel
Moderator
1,639 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.


0 Kudos
Reply