Runtime loading of shared libraries

8 ビュー (過去 30 日間)
Natesh Srinivasan
Natesh Srinivasan 2013 年 5 月 14 日
Hello Guys,
I have written a c++ library (lest us say libMyLIB.so) that I have wrapped using mex.
Now, when I start matlab from the linux terminal, the calls to the library work fine.
However, when I start matlab from the icon in the unity applet, I get an error which says " cannot open shared library libxxxx.so", where libxxx is needed by libMYLIB.so.
I assume that this is because libxxx.so is in an unconventional path that is specified in the ~/.bashrc file.
I was wondering if there is any way I could specify something inside Matlab to make it look into other paths in the sytem.
Setting $LD_LIBRARY_PATH in matlab seems to make no difference. Are there any other path variables that need to be set.
Any help would be appreciated.
  3 件のコメント
Natesh Srinivasan
Natesh Srinivasan 2013 年 5 月 15 日
I use matlab's setenv and I verfied checking the current value of $LD_LIBRARY_PATH.
I also tried the ldconfig way to make sure that the path is globally set across for all users in the system. But still the same error :(
Ashish Uthama
Ashish Uthama 2013 年 5 月 15 日
I would try running !ldd libMyLIB.so in both scenarios to see if it tells me something. To confirm - you launch MATLAB from unity, call the mex file from the MATLAB command prompt, and you get a system error? (I dont use unity, so I am not sure if it sandboxes applications or has a different uid.. or ...)

サインインしてコメントする。

回答 (1 件)

Ashish Uthama
Ashish Uthama 2013 年 5 月 15 日
Use ldconfig or use MATLAB's setenv.

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by