- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Im new to intel SGX development and decided to follow the labs provided on Intel® Software Guard Extensions (Intel® SGX) Web-Based Training.
Link is provided:
While doing the task 2.5: Add a trusted call to an Enclave project (starting from page 26) Everything went smoot untill page 29 in which there is a sample code provided for the main() function which is provided in pic1.
But there seems to be no defined ENCLAVE_FILE so I thought I must have been a typo and put ENCLAVE_FILE_T defined at the top but that seems to be not acceptable as well provided in pic 2.
Also in the files that are quto generated in Enclave_u.h there seems to be "İ" letter included in definitions I think this may cause a problem should I change it? Provided in pic3.
Thanks in advance for any help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello pheles,
Your ConsoleApp properties should be:
Debugging | Working Directory: $(OutDir)
C\C++ | General | Additional Include Directories: $(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)
Linker |
General | Additional Library Directories: $(SGXSDKInstallPath)\bin\$(Platform)\Debug;%(AdditionalLibraryDirectories)
General | Output File: $(OutDir)$(TargetName)$(TargetExt)
Input | Additional Dependencies: sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)
Sincerely,
Jesus G.
Intel Customer Support
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello pheles,
Make sure to download the lab manual and open it as a PDF outside of the browser so that the code shows up correctly.
The ENCLAVE_FILE definition looks like this:
#define ENCLAVE_FILE _T("enclave.signed.dll")
There is a space between ENCLAVE_FILE and _T so the subsequent references should be to ENCLAVE_FILE.
The generated "İ" may be due to your language settings in Visual Studio. It should be regular "I." You can try either way and see what works.
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello again!
Thank you so much for the reply. I did all of the changes however I'm still getting errors which are:
1>------ Build started: Project: ConsoleApp, Configuration: Debug Win32 ------
1>ConsoleApp.cpp
1>Enclave_u.c
1>ConsoleApp.obj : error LNK2019: unresolved external symbol _sgx_create_enclavew referenced in function _main
1>ConsoleApp.obj : error LNK2019: unresolved external symbol _sgx_destroy_enclave referenced in function _main
1>Enclave_u.obj : error LNK2019: unresolved external symbol _sgx_ecall referenced in function _foo
1>Enclave_u.obj : error LNK2019: unresolved external symbol _sgx_oc_cpuidex referenced in function _Enclave_sgx_oc_cpuidex
1>Enclave_u.obj : error LNK2019: unresolved external symbol _sgx_thread_wait_untrusted_event_ocall referenced in function _Enclave_sgx_thread_wait_untrusted_event_ocall
1>Enclave_u.obj : error LNK2019: unresolved external symbol _sgx_thread_set_untrusted_event_ocall referenced in function _Enclave_sgx_thread_set_untrusted_event_ocall
1>Enclave_u.obj : error LNK2019: unresolved external symbol _sgx_thread_setwait_untrusted_events_ocall referenced in function _Enclave_sgx_thread_setwait_untrusted_events_ocall
1>Enclave_u.obj : error LNK2019: unresolved external symbol _sgx_thread_set_multiple_untrusted_events_ocall referenced in function _Enclave_sgx_thread_set_multiple_untrusted_events_ocall
1>C:\...\Source\Repos\ConsoleApp\Debug\ConsoleApp.exe : fatal error LNK1120: 8 unresolved externals
1>Done building project "ConsoleApp.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
And here is the pic provided:
I don't understand what I did wrong?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello pheles,
Ensure you have set the correct project properties by comparing your console app with a known good app, such as from SampleEnclave from the SGX SDK.
Copy the properties from the SGX SDK/SampleEnclave to your existing project.
- Open two instances of Visual Studio.
- SGX SDK/SampleEnclave - the Source, the known good configuration. Do not change these properties.
- YourProject - the Target, the project you want to change.
- Open the Project Properties for the Source and for the Target so that you can see them side-by-side.
- Copy all of the properties from the Source to the Target.
- At the top of the Property Pages window, select Configuration: Debug, Platform: x86 (or other desired configuration).
- Ensure all settings are the same in all fields:
Configuration Properties |
- General
- Advanced
- Debugging
- VC++ Directories
- C/C++ | All Options
- Linker | All Options
- Build Events | Post-Build Event
- Check all other fields to ensure that they are the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello again!
I couldnt find the SGX SDK/SampleEnclave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello pheles,
If you installed the Intel SGX SDK for Windows then you will find it at C:\Program Files (x86)\Intel\IntelSGXSDK\src\SampleEnclave.
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I do have Intel SGX SDK and found it at C:\Program Files (x86)\Intel\IntelSGXSDK\src\SampleEnclave. But when I try to run it this is the outcome:
First I get this popup:
Then these errors:
And when I checked on Enclave_t.h this is the outcome:
At the end the build fails. I did not changed anything in sample application so I dont understand what I did wrong? Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello again,
Also after changing some of the options this is the pop up I get:
Which is the path of the .exe and "system cannot find the file specified" error.
Here are the error list:
The enclave part works without any errors but consoleApp does not for some reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello pheles,
Your ConsoleApp properties should be:
Debugging | Working Directory: $(OutDir)
C\C++ | General | Additional Include Directories: $(SGXSDKInstallPath)\include;%(AdditionalIncludeDirectories)
Linker |
General | Additional Library Directories: $(SGXSDKInstallPath)\bin\$(Platform)\Debug;%(AdditionalLibraryDirectories)
General | Output File: $(OutDir)$(TargetName)$(TargetExt)
Input | Additional Dependencies: sgx_urts.lib;sgx_uae_service.lib;%(AdditionalDependencies)
Sincerely,
Jesus G.
Intel Customer Support
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This thread has been marked as answered and Intel will no longer monitor this thread. If you want a response from Intel in a follow-up question, please open a new thread.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page