C/C++ Programmer's Guide (G06.27+, H06.03+)

Table Of Contents
Compiler Pragmas
HP C/C++ Programmer’s Guide for NonStop Systems429301-010
13-112
VERSION3
°
nld Manual
°
noft Manual
Before compiling existing applications using VERSION3, you should first use the
MIGRATION_CHECK on page 13-62 directive along with the VERSION2 pragma to
examine the code for references to functions in changed or unsupported headers.
The VERSION3 Standard C++ Library supports wide characters as described in the
standard, and converts from Multi-Byte to wide.
At the G06.20 RVU, all the native C++ header files were combined into one
product number (T2824). These headers were modified to identify the version used
in the compile and to redirect calls to the correct library.
VERSION3 headers do not typically have a .h file extension. For example, you
should specify:
#include <iostream>
instead of: #include <iostream.h> (OSS)
or instead of: #include <iostreah> (Guardian)
For VERSION3 you can use the standard header names without truncation as long
as you also use the CPATHEQ file named SLMAP as described in Pragmas for the
Standard C++ Library on page 5-12.
The T2824 C++ headers include a few that end with .h (such as fstream.h and
iomanip.h) for compatibility with previous C++ versions. If you include one of
these .h header files when using VERSION3, the compiler issues this error:
This header file is incompatible with C++ version 3
HP recommends that VERSION3 users use the C-name headers that are part of
the Standard C++ Library instead of the older C headers. For example, specify:
#include <cstdio>
instead of:
#include <stdio.h>
If you include the RUNNABLE option when compiling VERSION3 on Guardian
environment (or if you do not include -c On OSS environment), the compiler
automatically links:
°
ZSTLSRL for TNS/R programs or ZCPPCDLL and ZCPP3DLL for TNS/E
programs (the Standard C++ Library and the C++ run-time library)
°
LIBCOBEY for a TNS/R program (an OBEY file that links the C run-time library
and the Common Run-Time Environment [CRE])
°
CPPINIT3 for a non-PIC code, or CPPINIT4 for a TNS/R PIC (lets you
override the new and delete functions)