cannot dynamically load executable
9 ビュー (過去 30 日間)
古いコメントを表示
I am trying to get gcc 4.6 working with Matlab R2008b. I know that the newer version of gcc hasn't been tested but lets say I have no other way out.
The problem that I have right now is that my file; though complies without error; shows the following error during runtime:
??? Invalid MEX-file '/home/mehdi1/Desktop/test.mexglx': /home/mehdi1/Desktop/test.mexglx: cannot dynamically load executable.
Hint: I used to get the following error when trying to run my program complied directly from gcc
./test: error while loading shared libraries: libgfortran.so.3: cannot open shared object file: No such file or directory
The solution was specifying the path to libgfortran in LD_LIBRARY_PATH. I am not sure how to do that with Matlab
0 件のコメント
回答 (2 件)
Kaustubha Govind
2011 年 6 月 9 日
First, I would recommend using the nm or ldd utilities to figure out all the library dependencies that are not being resolved (is this what you mean by trying to open the file in gcc?).
Once you have added the library paths to LD_LIBRARY_PATH, this should also be visible from MATLAB (you need to restart MATLAB after changing the environment variable so the new value is picked up). Try executing the following at the MATLAB prompt to see if LD_LIBRARY_PATH still has the path to libgfortran.so:
>> !printenv LD_LIBRARY_PATH
1 件のコメント
Walter Roberson
2011 年 6 月 9 日
I think the problem is that Syed does not know how to change the LD_LIBRARY_PATH
Seyd is using Linux, it appears to me.
Syed Bilal Mehdi
2011 年 6 月 9 日
1 件のコメント
Kaustubha Govind
2011 年 6 月 10 日
I'm not sure what the ldd error means, but have you ensured that the path to libgfortran.so.3 is visible on LD_LIBRARY_PATH from MATLAB?
>> !printenv LD_LIBRARY_PATH
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!