Showing results for 
Search instead for 
Did you mean: 

calling external dll functions that take C++ vectors

I'm trying to use a shared library in LabView, but I'm having trouble figuring out how to get certain functions to work.  Specifically, the functions I'm having trouble with take C++ vectors as inputs (vector<double>& to be exact).  Can I pass LabView data to such functions?  The LV documentation seems to suggest that I can, but I don't see anything that explains how.


Do I have to develop a wrapper to use vectors?  Would arrays be better?


I created the shared library, so I can change it, but I would prefer not to.

0 Kudos
Message 1 of 3

You cannot pass a C++ class from LabVIEW to a DLL.  Write a wrapper that takes a standard 1-D array, which you can pass easily.

0 Kudos
Message 2 of 3

No C++ object datatypes can not be passed by LabVIEW. Generally C++ objects datatypes can not even be passed between object modules that are not compiled in the same compiler version, as the C++ ABI differs greatly between different compilers and even different versions of the same compiler.

Rolf Kalbermatter
Averna BV
LabVIEW ArchitectLabVIEW ChampionLabVIEW Instructor
0 Kudos
Message 3 of 3