Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Kirin_Young
Beginner
161 Views

sgx application runtime error for can not find .so lib

Jump to solution

I had successfully build a sgx application which called "test" and its gcc code is "gcc test.cpp -L. -lmyso". The libmyso.so(-lmyso) was created by makefile and I counld find it in current directory. But when I used "./test" to run the application, it faild with the error "can not open/find the shared library libmyso.so". So stranger! What should I do to run the app?

 

My platform is Ubuntu16.04, SGX SDK and PSW are installed sucessfully. But I am not sure intel ME is installed in my computer, is it related to this?

0 Kudos
1 Solution
Scott_R_Intel
Employee
161 Views

You may need to add your current app path to the library path.  For example, to do this temporarily while running your app (notice the . at the end to indicate current directory):

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./test

FYI:  https://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable

Regards.

Scott

View solution in original post

3 Replies
Scott_R_Intel
Employee
162 Views

You may need to add your current app path to the library path.  For example, to do this temporarily while running your app (notice the . at the end to indicate current directory):

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./test

FYI:  https://serverfault.com/questions/279068/cant-find-so-in-the-same-directory-as-the-executable

Regards.

Scott

View solution in original post

161 Views

There is a good article about this: https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html

In short: use either $LD_LIBRARY_PATH or rpath. Both solutions have upsides and downsides, as explained in linked article.

Kirin_Young
Beginner
161 Views

Thank you for all your responses. I learned a lot and solve my problems.

Reply