C/C++ Programming Language Instructions

Linux

NI-488.2 includes libni4882.so, a dynamic library you can use from your C/C++ applications.

To use the library, include the following line at the beginning of your program:

#include "ni4882.h"

To have the library explicitly loaded on demand when your application accesses the library, include libni4882.a during the link phase of your application, as shown in the following examples:

gcc prog.c libni4882.a -ldl

or

g++ prog.cpp libni4882.a -ldl

macOS

NI-488.2 provides NI4882.framework for macOS, which can be used from C/C++ applications.

To use the framework, include the following line at the beginning of your program:

#include <NI4882/ni4882.h>

To compile and link your application, include NI4882.framework in your project. The framework is located in /Library/Frameworks.

To compile and link your application in a Terminal Shell, type the following code on the command line:

cc cprog.c -framework NI4882

or

gcc cprog.c -framework NI4882