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-57
LINKFILE
LINKFILE
The LINKFILE pragma invokes the appropriate linker and specifies a command file to
be passed to either:
The nld utility when working with conventional code
The eld or ld utility when working with PIC (Position-Independent Code), as when
compiling a dynamic-link library (DLL)
file-name
specifies a valid command file for the eld utility, the ld utility, or the nld utility.
For syntax and semantics of eld command files, see the eld Manual.
For syntax and semantics of ld command files, see the ld Manual.
For syntax and semantics of nld command files, see the nld Manual.
The pragma default settings are:
Usage Guidelines
On Guardian environment, the LINKFILE pragma must be entered on the
compiler RUN command line for native C and C++.
LINKFILE invokes eld or ld rather than nld if you include SHARED or
CALL_SHARED.
Use the LINKFILE pragma to specify in a text file the names of the object files or
linkfiles (not source files) that make up a program for linking with a linker utility.
An example of LINKFILE appears in Examples on page 16-12.
The C or C++ run-time libraries are linked to the program only if the RUNNABLE
pragma is also specified on Guardian environment. On OSS environment, you
must specifically invoke the linker.
The compiler driver does not verify the existence or the readability of the command
file specified in the LINKFILE directive.
LINKFILE "file-name"
SYSTYPE GUARDIAN SYSTYPE OSS
TNS C compiler N.A. N.A.
G-series TNS c89 utility N.A. N.A.
TNS/R native C and C++ compilers Not set Not set
Native c89 utility Not applicable Not applicable
TNS/E native C and C++ compilers Not set Not set