C/C++ Programmer's Guide (G06.25+)
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
16-1
16
Compiling and Linking TNS/R Native
C and C++ Programs
•
Selecting a Development Platform on page 16-2
•
Specifying Header Files on page 16-3
•
Compiling and Linking Floating-Point Programs on page 16-4
°
Using Compiler Pragmas IEEE_Float and Tandem_Float on page 16-5
°
Using Link Options to Specify Floating-Point Format on page 16-5
°
Link-Time Consistency Checking on page 16-6
°
Run-Time Consistency Checking on page 16-7
°
Linking Mixed-Language Programs on page 16-8
•
Working in the Guardian Environment on page 16-9
°
Compiling a Module on page 16-9
°
Linking a Module on page 16-12
°
CRTLMAIN File on page 16-13
°
Shared Run-Time Libraries (SRLs) on page 16-13
°
SRLs and Dynamic-Link Libraries (DLLs) on page 16-14
°
Determining Which SRLs Are Required on page 16-14
The TNS/R 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 of the
headers and source files it includes, except for any source lines skipped as the result
of conditional preprocessor directives.
The nld utility links object files generated by the compilers and produces an
executable object file (a program file).
The ld utility is the TNS/R native linker that links PIC (Position-Independent Code)
linkfile
s to produce PIC loadfiles.
The SQL compiler processes executable files and generates code for embedded SQL
statements.
The native c89 utility controls the C and C++ compilation system in the Open System
Services (OSS) environment. Note that the c89 utility on H-series systems can
generate TNS/R code for linking by the ld utility (not the eld utility) when the
-Wtarget=TNS/R flag is used; discussions of OSS c89 in this section therefore apply
to H-series users when that flag is specified.
For information on how to compile and link programs in the OSS environment, see the
c89(1) reference page online or in the Open System Services Shell and Utilities
Reference Manual. For information on converting from TNS c89 to TNS/R native c89,
see the TNS/R Native Application Migration Guide.