I add the -sgx_pthread in the Makefile
but when i run the make,there is an error:
CXX <= Enclave/Enclave.cpp
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `_pthread_wakeup(unsigned long) [clone .part.0]':
pthread.cpp:(.text._Z15_pthread_wakeupm.part.0+0x2d): undefined reference to `pthread_wakeup_ocall'
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `_pthread_wait_timeout(unsigned long, unsigned long)':
pthread.cpp:(.text._Z21_pthread_wait_timeoutmm+0x30): undefined reference to `pthread_wait_timeout_ocall'
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `pthread_create':
pthread.cpp:(.text.pthread_create+0x113): undefined reference to `pthread_create_ocall'
/usr/local/bin/ld: pthread.cpp:(.text.pthread_create+0x16c): undefined reference to `pthread_wait_timeout_ocall'
/usr/local/bin/ld: /opt/intel/sgxsdk/lib64/libsgx_pthread.a(pthread.o): in function `pthread_join':
pthread.cpp:(.text.pthread_join+0xe0): undefined reference to `pthread_wait_timeout_ocall'
collect2: error: ld returned 1 exit status
Makefile:216: recipe for target 'enclave.so' failed
I use the demo "helloworld" and add a thread in it,but there is an error.
I add the
-sgx_pthread
in the Makefile but when i run themake
,there is an error:how to fix it?