cannot dynamically load executable
조회 수: 10 (최근 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!