Open System Services Porting Guide (G06.24+, H06.03+)

Table Of Contents
The Development Environment
Open System Services Porting Guide520573-006
2-4
Compilation Options for C and C++ Programs
TNS/R native object files to a TNS/R system for execution. The TNS/E native
compilation tools are supported only on TNS/E systems.
Cross-compilation is supported for the TNS/R and TNS/E native development tools,
allowing you to compile your C or C++ source code in one development environment
(Guardian or OSS on a NonStop system or ETK on a PC).
As mentioned earlier, you may decide to develop, compile, and debug your C and C++
code on your PC. Then, if you followed the ISO/ANSI C standards discussed in Porting
Is Easier When Standards Are Used on page 1-2, transferring code to the OSS
environment and executing it there should be relatively easy.
Working on a PC or on a NonStop system, you have many options for developing your
C and C++ application programs:
1. Compile your C or C++ code with the ETK on your PC. Then transfer your files to
the OSS environment on the NonStop system to run in a native environment.
2. Develop, compile, and debug C or C++ code in the OSS environment with the
TNS/R native C compilation tools on a G-series system as discussed in the Open
System Services Programmers Guide and the C/C++ Programmer’s Guide.
3. Develop, compile, and debug C or C++ code in the OSS environment with the
TNS/E native C compilation tools on an H-series system as discussed in the Open
System Services Programmers Guide and the C/C++ Programmer’s Guide.
4. Develop and compile (but not debug) C or C++ code in the OSS environment with
the TNS/R native C compilation tools on an H-series system as discussed in the
Open System Services Programmer’s Guide and the C/C++ Programmer’s Guide.
5. Develop, compile, and debug C or C++ code in the G-series OSS environment with
the TNS C compilation tools as discussed in the Open System Services
Programmer’s Guide and the C/C++ Programmers Guide.
6. Develop, compile, and debug C or C++ code in the Guardian environment with the
native C compilation tools on either a G-series or H-series system as discussed in
the Guardian Programmer’s Guide and C/C++ Programmer’s Guide.
7. Develop, compile, and debug C or C++ code in the Guardian environment on a
G-series system with the TNS C compilation tools as discussed in the Guardian
Programmers Guide and C/C++ Programmer’s Guide.
8. Develop, compile, and debug C or C++ code in the Guardian environment on an
H-series system with the TNS C compilation tools as discussed in the Guardian
Programmers Guide and C/C++ Programmers Guide.
For compilation Option 2 through Option 7, you can also cross-compile for the opposite
environment; that is, generate a Guardian executable file from the OSS environment
and vice versa. For compilation option 8, you cannot cross-compile for the opposite
environment because the H-series OSS environment does not support TNS
compilation and execution. Table 2-1 presents the cross-compile options available with
PC compilers and HP compilers generating executable files for the OSS and Guardian