Intel Confidential Computing
Discussion board focused on Intel Confidential Computing technologies and how they can protect data and AI security, privacy, and sovereignty.

sgx application runtime error for can not find .so lib

Kirin_Young
Beginner
2,468 Views

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
Moderator
2,468 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

0 Kudos
3 Replies
Scott_R_Intel
Moderator
2,469 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

0 Kudos
Spisak-Spisacki__Krz
2,468 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.

0 Kudos
Kirin_Young
Beginner
2,468 Views

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

0 Kudos
Reply