Linking Programs; C Programs - HP nld Manual

Table of Contents

Advertisement

nld Utility

Linking Programs

C Programs

C++ Programs
COBOL Programs
pTAL Programs
Mixed-Language Programs
Programs With Embedded NonStop SQL/MP
Note. You can only link linkfiles into a program. You cannot link loadfiles, or a combination of
loadfiles and linkfiles, into a program.
C Programs
C programs require access to their run-time environments. To create an executable C
program, you must link to the run-time environment initialization code and the shared
run-time libraries (SRLs) your program uses. The NMC and c89 compilers
automatically link to the required items. If you use nld directly to link a C program, you
must specify these items in nld options.
Follow these step to create an executable C program using nld:
1. Link together the object code files that you compiled.
2. Link to the C run-time library initialization object code file:
Environment
Guardian
OSS
3. Link to the SRLs that your program uses. To link the standard set of C SRLs, use
the following options:
Environment
Guardian
OSS
4. If your program uses active backup programming functions, such as
__ns_start_backup(), link to the active backup programming support object
code file:
Environment
Guardian
OSS
on page 2-9
on page 2-10
on page 2-12
on page 2-13
on page 2-13
Run-Time Library Initialization Object Code File
$SYSTEM.SYSTEM.CRTLMAIN
/usr/lib/crtlmain.o
Option for Linking the Standard Set of C SRLs
-OBEY $SYSTEM.SYSTEM.LIBCOBEY
-obey
/usr/lib/libc.obey
Active Backup Programming Support Object Code File
$SYSTEM.SYSTEM.CRTLNS
/usr/lib/crtlns.o
nld and noft Manual—520384-003
on page 2-13
2 -9
Linking Programs

Advertisement

Table of Contents
loading

This manual is also suitable for:

Noft

Table of Contents