Intel Confidential Computing
Discussion board focused on Intel Confidential Computing technologies and how they can protect data and AI security, privacy, and sovereignty.
1558 Discussions

Cannot include certain header files in enclave project.

Nazmus_S_
Débutant
4 282 Visites

Hello, everyone.

I am facing difficulty while trying to include certain header files in enclave project. For instance, the following statements result into a warning message (cannot open source file):

#include <malloc.h>

#include <atomic>

Although the application project can successfully include these header files, the enclave project fails to do so. Any idea?

Thanks.

 

 

0 Compliments
1 Solution
Juan_d_Intel
Employé
4 282 Visites

Are you using the SGX SDK 1.7 release and the libc++ library?

Your enclave should include $(SGXSDKInstallPath)include\libc++ instead of $(SGXSDKInstallPath)include\stlport

Voir la solution dans l'envoi d'origine

0 Compliments
7 Réponses
Juan_d_Intel
Employé
4 282 Visites

Try including <stdlib.h> and <stdatomic.h>

0 Compliments
Nazmus_S_
Débutant
4 282 Visites

Hi Juan,

Thanks for your reply.

Is it possible to include standard C++11 headers like <atomic> in an enclave project?

Nazmus

0 Compliments
Juan_d_Intel
Employé
4 282 Visites

On Windows yes, because we support C++11.

The Linux SGX SDK doesn't support C++11 yet. However, there's a branch in github that shows a preliminary effort. It's not product quality though.

0 Compliments
Nazmus_S_
Débutant
4 282 Visites

Thanks for your response.

I am using Windows.

But, when I tried to include atomic header in an enclave project (#include <atomic>), I got an error "cannot open source file atomic".

Do I need to change any project configuration settings?

Nazmus

0 Compliments
Anusha_K_Intel
Employé
4 282 Visites

Hi,

I have used the same header file in my project and it is not showing any error. Which version of SGX and Visual studio are you using?

0 Compliments
Juan_d_Intel
Employé
4 283 Visites

Are you using the SGX SDK 1.7 release and the libc++ library?

Your enclave should include $(SGXSDKInstallPath)include\libc++ instead of $(SGXSDKInstallPath)include\stlport

0 Compliments
Nazmus_S_
Débutant
4 282 Visites

Thanks a lot Juan. It worked. Previously, I was using stlport in my enclave project.

Hi Anusha, I am using SGX SDK 1.7 and Visual Studio 2015 Professional.

Nazmus

0 Compliments
Répondre