Archived:How do I Dynamically Load LabVIEW Built Shared Libraries from C on Linux?

Updated Dec 11, 2018

National Instruments does not actively maintain this document.

This content provides support for older products and technology, so you may notice outdated links or obsolete information about operating systems or other relevant products.

Reported In

Software

  • LabVIEW

Operating System

  • Linux

Programming Language

  • C

Issue Details

If I build a shared library (.so file) on Linux and then try to load it dynamically from C instead of linking the shared library directly with the C program and the RT Engine, the program hangs when it attempts to initialize the RT Engine. The following example code demonstrates loading a shared library dynamically from C:

void *libHandle = dlopen("MyLabVIEWDLL.so", RTLD_NOW);

Solution

To correct this error and dynamically load LabVIEW built shared libraries on Linux, add one of the following declarations to the program: 

extern "C" void InitializeLVRTClient(); // C++ program
extern void InitializeLVRTClient(); // C program


Call this function without any arguments before using dlopen to load any LabVIEW built shared library.

This issue has been resolved as of LabVIEW 7.1.1 and above.

WAS THIS ARTICLE HELPFUL?

Not Helpful