Error while loading library
조회 수: 35 (최근 30일)
이전 댓글 표시
I am trying to load a shared library from the sample code provided in the matlab documentation.
addpath(fullfile(matlabroot,'extern','examples','shrlib'))
if not(libisloaded('shrlibsample'))
loadlibrary('shrlibsample')
end
But when it tries to load the library i get an error:
Error using loadlibrary
The MATLAB program file describing your library could not be found, possible Perl or file system error.
Any help is appreciated.
댓글 수: 2
Walter Roberson
2016년 7월 12일
Which MATLAB version are you using?
Have you installed a compiler and used
mex -setup
?
채택된 답변
추가 답변 (3개)
Toby Dewhurst
2018년 2월 28일
I had a very similar problem: When I tried,
addpath(fullfile(matlabroot,'extern','examples','shrlib'))
if not(libisloaded('shrlibsample'))
loadlibrary('shrlibsample')
end
I got:
Error using loadlibrary
Too many output arguments.
Following @Philip Borghesani's suggestion, I found that it was the "perl" command that was broken (returning too many outputs).
The problem turned out to be that MATLAB's built-in perl.m was shadowed by a perl.m in a toolbox I had downloaded from a third party.
댓글 수: 0
Philip Borghesani
2016년 7월 12일
편집: Philip Borghesani
2016년 7월 12일
Something quite odd is going on, This error is caused by a timeout waiting for the prototype file to be visible to MATLAB after supposedly successful creation. I have only questions and suggestions.
- If your current directory is not writable by you try changing to one that is.
- Make sure your tempdir is writable and the disk is not full
- If nether of these helps or is the problem try using the m_filename option to loadlibrary to specify the name and location of the prototype file that will be generated.
- If all else fails contact support.
댓글 수: 4
Jan Niklas Caspers
2016년 7월 14일
I got the same problem, when I tried the perl command I got as a reponse an empty answer, while when I use it on a computer where the loadlibrary works, I get the expected hello. So, how do I fix perl now?
Jan Niklas Caspers
2016년 7월 14일
Any responses from Matlab Support? Have the same error and tried all steps here.
댓글 수: 2
Walter Roberson
2016년 7월 14일
For a response from Mathworks Support you need to open a technical support case. This resource, MATLAB Answers, is replied to by volunteers, most of whom do not work for Mathworks.
참고 항목
카테고리
Help Center 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!