Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Specifying the Location of Shared Libraries on Disk

LabVIEW 2011 Help

Edition Date: June 2011

Part Number: 371361H-01

»View Product Info

To call a shared library with the Call Library Function Node, you must specify either the name of the shared library or the path to the shared library on disk. However, these two techniques produce different consequences when you distribute or relocate your VIs and applications. Use the following table to determine which technique addresses your particular use case.

Technique for Specifying Location Relevant use cases Basis of Search Algorithm Effects on Distribution
By name The shared library is in the system search path. Common examples include system shared libraries, such as kernel32.dll, and third party shared libraries designed for componentized reuse. System search algorithm LabVIEW does not include the shared library automatically in build specifications.
By path The shared library is private to your VI. Common examples include shared libraries that you wrote specifically for a particular VI. The path you specify LabVIEW automatically includes the shared library in build specifications.

To specify the location of a shared library, you can enter the name or path in the Library name or path text box of the Call Library Function dialog box. You can also wire the name or path to the path in input of the Call Library Function Node.

Caution  Do not specify the location of a system shared library, such as kernel32.dll, by path. Because LabVIEW automatically includes by-path shared libraries in build specifications, you might distribute a system shared library to another computer inadvertently. Redistributing some shared libraries, such as kernel32.dll, might cause the target computer to crash. Therefore, always specify system shared libraries by name.

Common Problems Loading a Shared Library by Name

If LabVIEW cannot locate a shared library by name, consider the following possible causes:

  • To locate shared libraries that you specify by name, LabVIEW uses a modified version of the system search algorithm defined by your operating system. Refer to the KnowledgeBase at ni.com for more information about how LabVIEW modifies the search algorithm on specific platforms.
  • Specifying a shared library by name is not the same as specifying a relative path to a shared library within the same directory as the calling VI. To specify the latter, enter ./shared library name as the path to the shared library.

Common Problems Loading a Shared Library by Path

If LabVIEW cannot locate a shared library by path, consider the following possible causes:

  • If you use a relative path to specify the location of the shared library, LabVIEW interprets the path relative to the location of the VI on disk.
  • If you use an absolute path to specify the location of the shared library, LabVIEW saves the relative location of the shared library rather than the absolute path. Therefore, if you change the location of the shared library relative to the VI, LabVIEW cannot locate the shared library and must search for it.

How LabVIEW Locates Missing Shared Libraries

If LabVIEW cannot locate a shared library that you specified either by name or by path, LabVIEW searches the VI search path for the missing shared library. If LabVIEW finds the shared library, it updates the path to the shared library within the Call Library Function dialog box.

Searching for missing shared libraries requires extra time, displays an unavoidable search dialog box, and causes unsaved changes in the calling VI that you must save yourself. Therefore, configure VIs with the correct name or path information for shared libraries whenever possible.

Note  You can configure stand-alone applications to search for shared libraries in specific locations on a target computer by using a .ini file. Refer to the KnowledgeBase at ni.com for more information about using a .ini file to help a stand-alone application locate a shared library.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit