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?
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.
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.
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.