loadlibrary doesn't load all functions from dll

7 visualizaciones (últimos 30 días)
Kunz
Kunz el 1 de Mzo. de 2012
Hello there, I'm trying to load a dll file into Matlab using loadlibrary, but so far I'm only able to load the first 4 functions listed in the .h file that associates with the .dll file. There are over a hundred functions. I did received a couple warnings on the nonexistence of the 'error' data type, which I suppressed with this method ( http://www.mathworks.com/matlabcentral/answers/259-warnings-returned-by-loadlibrary). So when I deleted the first 4 functions from the .h file the loadlibrary function doesn't work. So I'm not sure if this has to do with the composition of the .h file (which I don't think is problematic) or there are some caveats that I didn't realize when I use the loadlibrary function? Below is the code that I wrote,
warning off MATLAB:loadlibrary:TypeNotFound
warning off MATLAB:loadlibrary:TypeNotFoundForStructure
tec5_libfile = ['C:\Program Files\...dll'];
tec5_hfile = ['C:\Program Files\...h'];
[tec5_notfound, tec5_warnings] = loadlibrary(tec5_libfile,tec5_hfile);
libfunctions SDACQ32MP
I ignored the accurate addresses. They are correctly typed in my code, otherwise the function wouldn't work.
  1 comentario
Philip Borghesani
Philip Borghesani el 1 de Mzo. de 2012
More information is needed before any useful solutions can be proposed. What are the exact messages output? What are the contents of tec5_warnings? If this is huge show us the begging of it. Can you post part of the header file with functions that work and those that do not? Are the missing functions in tec5_notfound or just plain missing? Can you supply information or a link to the documentation for the library you are attempting to load?
I suggest not disabling any warnings until you can successfully use the library and you know the warnings are not relevant.

Iniciar sesión para comentar.

Respuestas (1)

Kunz
Kunz el 1 de Mzo. de 2012
This problem is solved. There's a small error in the 5th function in the loaded header file...

Categorías

Más información sobre Language Support en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by