- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for all your responses. I learned a lot and solve my problems.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page