Rogue Wave banner
Previous fileTop of DocumentContentsNext file

4.6 Compiling on Unix

This section describes how to use Unix compilers to compile programs that use Rogue Wave's Threads.h++ class libraries.

To use the Threads.h++ libraries in your own program:

  1. Add the directory containing the Threads.h++ header files to your include list.

  2. Link to the appropriate Threads.h++ and Tools.h++ libraries.

  3. For instance, to build a program called myapp that uses the pointer library from the Smart Pointer package, you might use the following command line (all on one line):

    CC -Irwav/workspaces/SOLARIS25/SUNPRO42/4s myapp.cpp 
       rwav/workspaces/SOLARIS25/SUNPRO42/4s/lib/libtls4s.a
       rwav/workspaces/SOLARIS25/SUNPRO42/4s/lib/libpointer4s.a
       rwav/workspaces/SOLARIS25/SUNPRO42/4s/lib/libsync4s.a
       rwav/workspaces/SOLARIS25/SUNPRO42/4s/lib/libthrexcept4s.a
       rwav/workspaces/SOLARIS25/SUNPRO42/4s/lib/libtrace4s.a -o myapp

    The example assumes the libraries were exported to the rwav/workspaces/SOLARIS25/SUNPRO42/4s directory.

4.6.1 Using a Static Version of Threads.h++

If you linked to a static set of Threads.h++ libraries, you are ready to run the resulting program.

4.6.2 Using a Shared Version of Threads.h++

If you linked to a shared set of Threads.h++ libraries, before running the resulting program be sure that the library location is available in the environment variable that your operating system uses to describe the possible locations of shared libraries. For many operating systems, this environment variable is LD_LIBRARY_PATH. Some operating systems use a different name; be sure to use the one appropriate to your operating system.


NOTE: This step is recommended for all shared UNIX Threads.h++ libraries, and required for some platforms.

You may set the library path variable from your shell, or by including it in your rc or profile script.

For example, in a Korn or Bourne or similar shell, if your libraries are installed in the /usr/local/rwav/workspaces/SOLARIS25/SUNPRO42/4s/lib directory, use the following command (all on one line):

If you use the C shell or a similar shell, the command is:



Previous fileTop of DocumentContentsNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.