Linking to C++ Libraries
You can compile and link any C++ module to one or more libraries. HP aC++ automatically links the following libraries with a C++ executable.
•/usr/lib/hpux##/libCsup.so (the HP aC++ runtime support library)
•/usr/lib/hpux##/libstd_v2.so (standard C++ library:
•/usr/lib/hpux##/libc.so (the
•/usr/lib/hpux##/libdl.so (routines to manage shared libraries)
•/usr/lib/hpux##/libunwind.so (routines to unwind exceptions)
•/usr/lib/hpux##/libm.so (math library)
NOTE:
•When you specify the
•When you specify the +std=c++11 (or the currently deprecated
Linking with Shared or Archive Libraries
If you want archive libraries instead of shared libraries, use the
Refer to the
Specifying Other Libraries
You can specify other libraries using the
aCC myapp.C
Creating and Using Shared Libraries
This section describes shared libraries that are specific to HP aC++. It discusses the following topics:
•Compiling for Shared Libraries
•Linking Archive or Shared Libraries
Compiling for Shared Libraries
To create a C++ shared library, you must first compile your C++ source with either the +z or +Z option. These options create object files containing
Example
The following example compiles util.C, generates
aCC
180 Tools and Libraries