Is there a way to make dll library compatible with STL contatiners when usin loadlibrary
이전 댓글 표시
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 ?
답변 (1개)
Kaustubha Govind
2012년 10월 16일
0 개 추천
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.
카테고리
도움말 센터 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!