我正在嘗試編寫一個簡單的SGX項目作爲開始。所以,我有,我已經差不多從Lars Richter's blog複製此主主機應用程序:加載Enclave時出錯:無法使用CreateFile()打開文件
#define ENCLAVE_FILE _T("Enclave.signed.dll")
#include <tchar.h>
#include <cstdio>
#include "sgx_urts.h"
#include "Enclave_u.h"
int main()
{
sgx_enclave_id_t eid;
sgx_status_t ret = SGX_SUCCESS;
sgx_launch_token_t token = { 0 };
int updated = 0;
ret = sgx_create_enclave(ENCLAVE_FILE, SGX_DEBUG_FLAG, &token, &updated, &eid, NULL);
if (ret != SGX_SUCCESS) {
printf("\nApp: error %#x, failed to create enclave.\n", ret);
}
scanf("\n");
return 0;
}
它編譯罰款(我使用的是英特爾C++編譯器17.0與Visual Studio 2015年),但它不會加載飛地。我收到以下錯誤信息:
[sgx_create_enclavew ..\urts\win\urts.cpp:195] Couldn't open file with CreateFile()
App: error 0x200f, failed to create enclave.
確實存在Enclave.signed.dll某處sgx_create_enclave會發現它? –
它位於解決方案的調試文件夾中。 –
什麼讓你覺得sgx_create_enclave(不管那是什麼)會在那裏找到它? –