C/C++ Programmer's Guide (G06.27+, H06.08+, J06.03+)
You can disable version checking by designating a loadfile CPPNEUTRAL using a linker. You
can also display the C++ version of a loadfile by using the LISTATTRIBUTES command of
enoft or noft. For more details, see the:
◦ eld Manual
◦ enoft Manual
◦ ld Manual
◦ nld Manual
◦ noft Manual
• Before compiling existing applications using VERSION3, you should first use the
MIGRATION_CHECK (page 217) 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 (page 88).
• 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)
For information about TNS/R SRLs, see Shared Run-Time Libraries (SRLs) (page 294). For
more details about the TNS/E DLLs, see Dynamic-Link Libraries (DLLs) (page 307).
VERSION3 257