Error while loading library
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 12 Juil 2016
Which MATLAB version are you using?
Have you installed a compiler and used
mex -setup
?
Sandeep
le 12 Juil 2016
Modifié(e) : Walter Roberson
le 12 Juil 2016
Réponse acceptée
Plus de réponses (3)
Toby Dewhurst
le 28 Fév 2018
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.
Philip Borghesani
le 12 Juil 2016
Modifié(e) : Philip Borghesani
le 12 Juil 2016
0 votes
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 commentaires
Sandeep
le 13 Juil 2016
Philip Borghesani
le 13 Juil 2016
Modifié(e) : Philip Borghesani
le 13 Juil 2016
My only other thought is that the matlab perl command is broken. To test it create a file testperl.pl containing:
print "hello";
Then try to run it from matlab:
>> perl('testperl.pl')
ans =
hello
Jan Niklas Caspers
le 14 Juil 2016
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?
Sandeep
le 19 Juil 2016
Jan Niklas Caspers
le 14 Juil 2016
0 votes
Any responses from Matlab Support? Have the same error and tried all steps here.
2 commentaires
Walter Roberson
le 14 Juil 2016
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.
Sandeep
le 15 Juil 2016
Modifié(e) : Walter Roberson
le 15 Juil 2016
Catégories
En savoir plus sur Troubleshooting in MATLAB Compiler SDK dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
