Dynamic Runtime Linking | LabJack
 
« Close

Datasheets and User Guides

App Notes

Software & Driver

 

Dynamic Runtime Linking

The package below contains headers and a basic example for dynamic runtime linking with LJM.

Any examples in the C/C++ example download can be quickly modified to work with dynamic runtime linking by following the steps below:

    1.  Add an include for LabJackM_Dynamic.h   
    2.  Remove include for LJM_Utilities.h
    2a. Remove include for LJM_StreamUtilities.h (if applicable)
    3.  Add include for LJM_Utilities_Dynamic.h
    3a. Add include for LJM_StreamUtilities_Dynamic.h (if applicable)
    4.  Add a call to the LoadLabJackM function
    5.  Add "p" in front of all LJM function names

If compiling as C code, use the C99 (or gnu90) standard or later
Linux and macOS need to link against libdl. A typical, basic C example build could look like:

gcc -g -Wall foo.c -ldl -o foo

File Attachment: