Using the Import Shared Library Wizard
- Updated2025-01-22
- 2 minute(s) read
Using the Import Shared Library Wizard
Use the Import Shared Library wizard to create or update a LabVIEW project library of wrapper VIs for functions in a Windows .dll file, an OS X .framework file, or a Linux .so file.
The Import Shared Library wizard supports most C and C++ header files. The wrapper VIs the wizard creates use the Call Library Function Node, which does not support the C++ this pointer or calling methods in C++ classes.
The Import Shared Library wizard parses the header file, lists the functions in the shared library, converts data types in the shared library to LabVIEW data types, and generates a wrapper VI for each function. The wizard saves the VIs in a LabVIEW project library that you can edit and creates an HTML report about the generated library that you can launch when you complete the wizard.
In the wizard, you can specify include paths and preprocessor definitions, configure the individual VIs that wrap each function, and configure memory allocation and error handling. The wizard also creates custom controls for structure elements in the original functions and adds the controls to the project library. You can use the custom controls to modify all the VIs in the library that contain the corresponding data type.
You can run the wizard multiple times on the same shared library file. If you select the Update VIs for a shared library option on the Specify Create or Update Mode page, the wizard overwrites the previous version of the project library file and the existing VIs within that file. If you choose not to re-import generated VIs within the project library file, the VIs remain unchanged in the directory. The wizard retains the most recent settings for each individual function in a particular shared library. For example, if you have a shared library that contains three functions, you might update only the second function. The next time you run the wizard on that shared library file, it retains the original settings for functions one and three and the new settings for function two.
Select Tools»Import»Shared Library to launch the Import Shared Library wizard. Follow the prompts to create wrapper VIs for shared library files. You must provide the name of a shared library file and a header .h file for the wizard to parse.
Refer to the Importing Functions from a Shared Library File topic for step-by-step instructions for importing a shared library and creating wrapper VIs.