Is there a way to make dll library compatible with STL contatiners when usin loadlibrary
Mostra commenti meno recenti
Hi
I compiled a Dll project with vs2010 (VC10 compiler). Some function have STL containers (such as vectors,lists ...) in their interface. So far it seems to be impossible using these functions when loading the dll using 'loadlibrary'.
Is there an elegant was to use such functions ?
Risposte (1)
Kaustubha Govind
il 16 Ott 2012
0 voti
As per the documentation for loadlibrary, you need to specify a C header file, so you cannot use C++ datatypes like STL containers in the function prototype. The best I can think of is to create wrapper functions that take C-style containers and convert them to the STL containers before calling into the DLL. You might need to create another DLL for the wrapper versions.
Alternatively, if you're comfortable with C/C++, perhaps you could use MEX-functions to interface with the library instead of LOADLIBRARY.
Categorie
Scopri di più su STL (STereoLithography) in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!