Enclaves must be 100% native code, with no dependancies on shared libraries. There are no exceptions to these restrictions. The linkages to the ECALLs in your enclave, and the OCALLs made from your enclave, must be 100% native C (not C++) code. There are no exceptions to this restriction and perhaps most important, enclaves have to be built using the trusted C and C++ libraries provided by Intel. They are built to provide C/C++ libraries that do not contain instructions and operations that are not legal inside of enclaves. There's really not a practical way to "build" an enclave outside of the process.