Effacer les filtres
Effacer les filtres

Error using MATLAB "loadlibrary" function

39 vues (au cours des 30 derniers jours)
Arun
Arun le 10 Juil 2013
I am trying to load the NI DAQmx library "nicaiu.dll" and the associated header "nidaqmx.h" in MATLAB as given below:-
loadlibrary('nicaiu.dll','nidaqmx.h','alias','ni');
Please note that nicaiu.dll is 32-bit and along with nidaqmx.h reside in the current MATLAB(again 32-bit) folder. I am getting the following error:-
Warning: Warnings messages were produced while parsing. Check the functions you intend to use for correctness. Warning text can be
viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 344
Error using loadlibrary (line 419)
There was an error loading the library "C:\Documents and Settings\rendtest\My Documents\MATLAB\nicaiu.dll"
A dynamic link library (DLL) initialization routine failed.
Caused by:
Error using loaddefinedlibrary
A dynamic link library (DLL) initialization routine failed.
What am I doing wrong?

Réponse acceptée

Arun
Arun le 10 Juil 2013
After some research about dependencies of nicaiu.dll, I discovered that all the dependencies of the dll file must be solved for it to be loaded correctly. So, I had to point this to its original location (C:\Windows\System32) to solve this problem! So my loadlibrary call would look like:-
loadlibrary('C:\windows\system32\nicaiu.dll','nidaqmx.h','alias','ni');
With the above, my problem is resolved. Alternatively, there must be some way of adding the above path to the loadlibrary's location-to-look-for-libraries. For now, I shall close this question.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by