There was an error loading the library
Mostra commenti meno recenti
Dear all,
I put the compiled dll file (written in C) in 'C:\Program Files\MATLAB\R2011b\extern\include\
I have a problem when I tried to load the library using the following command:
hfile = [matlabroot '\extern\include\dll\spinapi.h']; loadlibrary('spinapi', hfile)
it gave me the following error message:
Error using loadlibrary (line 421) There was an error loading the library "spinapi" The specified module could not be found.
Caused by: Error using loaddefinedlibrary The specified module could not be found.
My operating system is 64bit Win7, matlab is 64bit version, compiler is Microsoft Software Development Kit (SDK) 7.1, which is recommended in http://www.mathworks.com/support/compilers/R2011b/win64.html
Does anyone know what the problem is? I almost tried every method that I could find in google. But they didn't help. I am so deperated......
One thing made me very confused was that, I did exactly the same in my old computer, its operating system is 32bit Windows XP, matlab is R2009a 32bit version, compiler is lcc-win32 C, and it could load the library without any error!!!
I will be very thankful to anyone who can help me.
Best Regards, Kit
1 Commento
Peter
il 13 Gen 2016
Open your spinapi.dll in Dependency Walker (google: depends22_x64.zip). You will see which .dll files need to be copy or installed with your spinapi.dll
Risposte (7)
Philip Borghesani
il 12 Gen 2012
2 voti
- Open .../bin/win64/matlab.exe with Dependency Walker.
- Start profiling
- Wait for MATLAB to come up and clear the log window
- Issue the loadlibrary command and examine the log in dDependency Walker for error messages.
The problem is probably a missing runtime library or other dll dependency.
Walter Roberson
il 11 Gen 2012
0 voti
'C:\Program Files\MATLAB\R2011b\extern\include\' is not on my matlabpath, so I cannot think of any reason MATLAB would think to look there for .dll files. Did you add that directory to your matlabpath ?
3 Commenti
Kit Mai
il 11 Gen 2012
Walter Roberson
il 12 Gen 2012
Are you able to load the sample library using the form showed in "addpath example" in http://www.mathworks.com/help/techdoc/ref/loadlibrary.html ?
Kit Mai
il 12 Gen 2012
Kit Mai
il 12 Gen 2012
0 voti
5 Commenti
Walter Roberson
il 12 Gen 2012
Hmmmm... I would wonder if you are really using the 64 bit version of MATLAB. Try giving the command
mexext
and see if it says mexw32 (32 bit MATLAB) or mexw64 (64 bit MATLAB)
Kit Mai
il 12 Gen 2012
Walter Roberson
il 12 Gen 2012
Hmmm, I don't know; perhaps someone else will have an idea.
Mumble mumble... thunk file related ???
Kit Mai
il 12 Gen 2012
Philip Borghesani
il 12 Gen 2012
Microsoft uses the same error messages for both 32 and 64 bit Windows. In their infinite wisdom they consider 64 bit programs to be written to the win32 api. There is no win64 api.
Kit Mai
il 12 Gen 2012
0 voti
Venugopal
il 17 Apr 2013
0 voti
I have the similar problem of Kit Mai...
Kit Mai.. did u find some solution??
dpsycho
il 21 Mag 2013
0 voti
Did you happen to have crashed before this happened?
I have the same thing. At some point everything worked, matlab crashed, and then could not load the library. Rebooted even and still no luck.
Muhammad
il 2 Lug 2024
0 voti
tm3Proj = projcrs('ESRI:53008');
Did you find the solution?
Categorie
Scopri di più su Search Path in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!