Does loadlibrary function loads all the functions in one dll?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SH
el 13 de Oct. de 2015
Comentada: Philip Borghesani
el 14 de Oct. de 2015
My problem is that loadlibrary takes long time to load all the functions in dll.
For example, I have A.dll and A.h, I use loadlibrary to load them, it would take several seconds. If I create a prototype file (A_proto.m) by loadlibrary, and invoke as loadlibrary('A.dll', @A_proto), it will save some time, but not enough.
My question is: Does MATLAB loads all the functions of the dll after I call "loadlibrary"? Even if I only use subset of the functions?
0 comentarios
Respuesta aceptada
Philip Borghesani
el 13 de Oct. de 2015
Yes, by default loadlibrary will load all functions found in the header file used to load or create the prototype file. The functions can be limited by modifying the header or commenting or removing functions and unneeded structures from the prototype file.
That said, unless there are a huge number of functions in the library I am not sure that is the cause of the problem. You might be better off profiling the loadlibrary call and or checking how long the prototype file takes to run by just running it from the command line.
For followup questions it would be useful to know what version of MATLAB you are using and on which platform. The loadlibrary line used to produce the prototype file would also be helpful.
What is the content of the second (notfound) output from loadlibrary?
2 comentarios
Philip Borghesani
el 14 de Oct. de 2015
It is possible that other packages deffer loading (calling getProcAddress) for functions until they are called. How the library is loaded changes dramatically because of thunkfile use between 32 and 64 bit programs so knowing what platform you are on would allow me to give better information.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!