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

17 Compiling and Linking TNS/E Native C and C++
Programs
The TNS/E native C and C++ compilers take as input a module (a translation unit) and generate
an object file or linkfile. A module is defined as a source file with all the headers and source files
it includes, except for any source lines skipped as the result of conditional preprocessor directives.
The eld utility is the TNS/E native linker that links PIC (Position-Independent Code) linkfiles to
produce PIC loadfiles.
The SQL compiler processes executable files and generates code for embedded SQL statements.
The native c89 and c99 utilities control the TNS/E native C and C++ compilation system in the
Open System Services (OSS) environment. Note that the c89 utility on TNS/E systems can generate
TNS/R code for linking by the TNS/R native linker utility (not the eld utility) when the
-Wtarget=tns/r flag is used; discussions of OSS c89 in Chapter 16: Compiling and Linking
TNS/R Native C and C++ Programs therefore apply to TNS/E users when that flag is specified.
For information on how to compile and link programs in the OSS environment, see the c89(1)
or c99(1) reference page online or in the Open System Services Shell and Utilities Reference
Manual.
For information about compiling and binding native C++ programs using the Windows PC
environment, see the online help for the HP Enterprise Tool Kit—NonStop Edition (ETK). In this
guide, the Enterprise Tool Kit is introduced in Chapter 18: Using the Native C/C++ Cross Compiler
on the PC.
For information about compiling and binding native C++ programs using NSDEE, see the online
help for NSDEE.
The Guardian CPPINIT* and OSS or PC cppinit* files used to create, replace, or delete C++
operators for TNS/R programs are not needed for TNS/E programs. For TNS/E, the files LIBCTXT
and libc.txt can be used for TNS/E linking. (This is similar to how Guardian LIBCOBEY and OSS
libc.obey files are used for TNS/R linking).
Selecting a Development Platform
A development platform consists of the hardware system and software environment available to
compile, link, and run a program.
You can develop OSS programs regardless of whether the OSS environment is available on the
system. However, you cannot run and test OSS programs on a system without the OSS environment.
It is easier to develop a program in the environment in which it runs, but you can develop a program
in one environment that runs in another environment, with a few restrictions. However, compile
times are much faster in the PC environment.
Table 47 describes the capabilities of each development platform.
Table 47 Development Platform Capabilities (TNS/E Native C and C++ Programs)
NSDEE on Windows PCETK on Windows PCSystem With
Guardian
System
With
Capability
and OSS
Environments
Guardian
Environment
YesNoYesYesUse Guardian
development tools for
Guardian programs?
YesNoYesYesUse Guardian
development tools for
OSS programs?
Selecting a Development Platform 299