I am trying to add OpenCV in my enclave project. I can run the OpenCV project as a standalone win32 console application in visual studio 2015. But when I started doing that in my enclave project I am getting errors. I tried to add the following libraries from opencv in enclave project:
#include "windows.h" #include <opencv2/core/core.hpp> #include "opencv2/imgcodecs.hpp" #include <opencv2/highgui/highgui.hpp> #include <opencv2/opencv.hpp> #include <opencv2/face.hpp> #include "drawLandmarks.hpp"
But I am getting tons of error. I also need to include windows.h file in my project. Are those libraries are allowed to include in the enclave project?
I'm not familiar enough with the OpenCV headers, but for sure you cannot include the Windows headers.
In general, you can't make any system calls inside an enclave.
The developer reference has more details on which APIs are / are not allowed.
Thank you for your comment. But do you know whether SGX-Enclave supports OpenCV or not? Because from my understanding, I think they only provide support for OpenSSl (if I am not wrong). I got this idea by visiting their download center :- https://software.intel.com/en-us/sgx-sdk/download
I followed the following steps while adding opencv static library in the project:-
1. Generated the OpenCV static library using CMake,
2. Added the following values in the inlucde directories :-
C:\Program Files (x86)\Intel\IntelSGXSDK\
includeC:\Program Files (x86)\Intel\IntelSGXSDK\ include\libc++C:\Program Files (x86)\Intel\IntelSGXSDK\ include\tlibcC:\Users\fs5ve\Downloads\ Opencv-static\static\opencv\ includeC:\Users\fs5ve\Downloads\ Opencv-static\static\opencv\ build-32-extra\install\includeC:\Users\fs5ve\Downloads\ Opencv-static\static\opencv\ build-32-extra\install\ include\opencvC:\Users\fs5ve\Downloads\ Opencv-static\static\opencv\ build-32-extra\install\ include\opencv2C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include%( AdditionalIncludeDirectories)
3. Added the following value in additional library directories:-
I am getting the following error:-
I have added "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include" in the Include directories. But after that I am getting the following error:-
Cannot open include file: 'malloc.h': No such file or directory