44.2. Incorporating the library into an application.

To incorporate the thread library in your software, you will need to ensure that the compiler can locate the library headers and the library, both at link time and at load time.

The library headers are in the include directory of the NSCLDAQ installation tree. The library is called libthreads and is in the lib directory of the installation tree.

In the compilation example below, we assume that an environment variable named DAQROOT has been defined to point to the top level of the NSCLDAQ installation tree:

Example 44-4. Compiling and linking NSCLDAQ threaded software


g++ -o mythreadedapp -I$DAQROOT/include mythreadedapp.cpp -L$DAQROOT/lib -lthreads \
    -Wl,"-rpath=$DAQROOT/lib"