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

sgx_ra methods not generated in Enclave_t.c

sarodh_u_
Beginner
627 Views

I receive the error below when compiling my enclave project. The edge8r generates the function prototypes in my Enclave_t.h but not in Enclave_t.c. If I were to create stubbed functions for the missing calls in my Enclave.cpp I'm able to compile successfully though I don't think this is intended. Thanks in advance! 

Error LNK2019    unresolved external symbol _sgx_ra_get_ga referenced in function _sgx_thread_set_multiple_untrusted_events_ocall                  

Error LNK2019    unresolved external symbol _sgx_ra_proc_msg2_trusted referenced in function _sgx_thread_set_multiple_untrusted_events_ocall 

Error LNK2019    unresolved external symbol _sgx_ra_get_msg3_trusted referenced in function _sgx_thread_set_multiple_untrusted_events_ocall  

 

//  EDL includes

from "sgx_tkey_exchange.edl" import *;

include "sgx_key_exchange.h"
include "sgx_tseal.h"
 

 

// Enclave.cpp includes

#include "sgx_tkey_exchange.h"
#include "sgx_utils.h"
#include "sgx_trts.h"

 

 

0 Kudos
1 Solution
Anusha_K_Intel
Employee
627 Views

Hi,

LNK2019 error occurs when the  object file or library that contains the definition of the symbol is not linked.Have you linked the enclave with sgx_tkey_exchange library? 

The enclave must be linked to the library which is added in the Right click Project->Properties-->Linker-> Additional Dependencies-> Edit and add the library if not added and Add the "sgx_ukey_exchange.h" to the application and link the "sgx_ukey_exchange" library to the application libraries and check.

 

View solution in original post

0 Kudos
2 Replies
Anusha_K_Intel
Employee
628 Views

Hi,

LNK2019 error occurs when the  object file or library that contains the definition of the symbol is not linked.Have you linked the enclave with sgx_tkey_exchange library? 

The enclave must be linked to the library which is added in the Right click Project->Properties-->Linker-> Additional Dependencies-> Edit and add the library if not added and Add the "sgx_ukey_exchange.h" to the application and link the "sgx_ukey_exchange" library to the application libraries and check.

 

0 Kudos
sarodh_u_
Beginner
627 Views

Thanks Anushka, 

I had to add sgx_tkey_exchange.lib under Project->Properties->Linker->Input->Additional Dependencies.

0 Kudos
Reply