Why report “/usr/local/lib/MatLabLib/mymatlab.dylib: no suitable image found. Did find: /usr/local/lib/MatLabLib/mymatlab.dylib: open() failed with errno=13”?
조회 수: 8 (최근 30일)
이전 댓글 표시
I build one Matlab script to mymatlab.dylib, but as I invoke it, it reported:
/usr/local/lib/MatLabLib/mymatlab.dylib: no suitable image found. Did find: /usr/local/lib/MatLabLib/mymatlab.dylib: open() failed with errno=13”
/usr/local/lib/MatLabLib/mymatlab.dylib: stat() failed with errno=22
I'm using MATLAB_R2019a, what does these errorno (13 / 22) mean?
댓글 수: 0
답변 (3개)
Walter Roberson
2021년 8월 14일
Error 13 means "permission denied".
This error is not given for the case where a file is not found. The error is given if a file is found but the user does not have authorization to use it, or if there is a directory in the path to the file that the user does not have authorization to examine (no directory x permission for the user). When the user does not have x permission all the way to the file then permission denied can occur even if the file does not exist.
Error 22 means "invalid argument"
Did find: /usr/local/lib/MatLabLib/mymatlab.dylib: open() failed with errno=13”
That part tells us that you do have x permission on all the appropriate directories, but that you do not have read permission on mymatlib.dylib .
It is possible that /usr/local/lib/MatLabLib/mymatlab.dylib exists as a symbolic link to a file (possibly in a different directory) that you do not have read access to. You should use
!ls -ld /usr/local/lib/MatLabLib/mymatlab.dylib
to see what you can find out about the file.
The Error 22 is probably a consequence of not being able to read the dylib file.
댓글 수: 0
Yongjian Feng
2021년 8월 13일
So you are doing this on Mac, right? Did you try to use the env var LD_LIBRARY_PATH to point to your dylib?
Use this from a terminal can tell you if you dylib has more dependencies.
otool -L
댓글 수: 3
Yongjian Feng
2021년 8월 13일
It is most likely related to LD_LIBRARY_PATH.
On your own Mac, use 'otool -L' to figure out its dependencies. It shall be the same in the other Mac.
- Make sure all the dependencies on your Mac have been installed properly on the other Mac.
- Use LD_LIBRARY_PATH on the other Mac to point to your dylib and all the dependencies you figured out in step 1.
S
2025년 10월 23일 4:50
kd=300;
c=pid(kd);
T=feedback(c*p,1)
t=0:01:2
step(T,t)
댓글 수: 1
Walter Roberson
2025년 10월 23일 6:14
Please explain in more detail how this answer solves the problem of errno 13 or errno 22 ?
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!