Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
23 Views

Edge Functions in Static Library

I have a static C++ library project that "imports" an enclave.

The static library is being used in another C++ application.

However, I get a "unresolved symbol" link error when building the app project. I suspect it has to do with the fact that the edge functions are C-linked. But I've already included the "..._u.h" header in every source file where the edges are called.

What can be causing this and how can it be solved?

0 Kudos
5 Replies
Highlighted
Employee
23 Views

Hi,

It seems that the enclave edl file is not properly imported to the application source.Please check the Application source files whether the edl file is imported or not.

0 Kudos
Highlighted
New Contributor I
23 Views

Hi Anusha, thanks for your reply.

What dll are you talking about? The enclave dll cannot possibly be an issue since my issue is at build time.

0 Kudos
Highlighted
Employee
23 Views

Intel SGX application doesn't support class objects. But we can create untrusted C++ application (without class) and call the edger
routine function(_u.h) written in 'C' without any issue. To resolve this 'C' linkage, automatically generated untrusted edger routine header (_u.h) file contains necessary macros.

Here you are calling some wrapper functions implemented in "Static library" from the Intel SGX application source. This wrapper function
is responsible for creating enclave and also initiate E-Call . While building the Intel SGX application source along with static library you got this linkage error while linking untrusted edger routines.

Since it works with Intel SGX application source written in C++, it should work with static libraries written in C++(without class).
Please make sure that linkage related project settings is fine and required libraries  are added with your build environment.

0 Kudos
Highlighted
Beginner
23 Views

Arya,I think Anusha said the EDL not DLL

0 Kudos
Highlighted
Employee
23 Views

Are you getting an error building the untrusted project?

What symbols are missing? Any edge-routine?

Could you post your project here? I wonder if the _u.h file is included in the proper place(s).

I agree with you that the C-linkage of the edge-routines may be the root-cause of this issue.

0 Kudos