Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
73 Views

Cannot include certain header files in enclave project.

Jump to solution

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 Kudos

Accepted Solutions
Highlighted
Employee
73 Views

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

View solution in original post

0 Kudos
7 Replies
Highlighted
Employee
73 Views

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

0 Kudos
Highlighted
Beginner
73 Views

Hi Juan,

Thanks for your reply.

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

Nazmus

0 Kudos
Highlighted
Employee
73 Views

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 Kudos
Highlighted
Beginner
73 Views

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 Kudos
Highlighted
Employee
73 Views

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 Kudos
Highlighted
Employee
74 Views

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

View solution in original post

0 Kudos
Highlighted
Beginner
73 Views

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 Kudos