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!