ld Manual

Introduction to ld
ld Manual529650.001
1-12
pTAL Programs
pTAL Programs
Because pTAL does not support embedded HP NonStop SQL/MP or a language-
specific run-time library, there are no special requirements for linking pTAL programs.
Mixed-Language Programs
You can create mixed-language programs containing native C modules, native C++
modules, native COBOL modules, and pTAL modules. The MAIN procedure in a
mixed-language program can be written in C/C++ or COBOL but not pTAL. Mixed-
language programs that include C/C++ modules require you to link to the same run-
time initialization code and run-time libraries that C or C++ programs do (see C++
Programs). Mixed-language programs that include COBOL modules require you to link
to the same run-time libraries that COBOL programs do (see COBOL Programs.).
Programs With Embedded NonStop SQL/MP
Native C and native COBOL programs can contain embedded NonStop SQL/MP
statements. You can use ld to create a single loadfile from multiple C or COBOL
object files that contain embedded NonStop SQL/MP statements. After creating a
loadfile with ld, use the NonStop SQL/MP compiler, SQLCOMP, to set up an
executable NonStop SQL/MP application.
Always run ld before SQLCOMP. Do not run SQLCOMP on a linkfile and use the
resulting file as ld input.
A user library cannot contain embedded NonStop SQL/MP.
Linking User Libraries
You can use ld to link object files into a single executable user library.
You use the -o option to specify the name of the resulting object file, and the -ul
option to specify that the resulting object file is a user library.
For example, in the Guardian environment, this command links the object files file1
and file2 into an executable user library named lib:
ld file1 file2 -o lib -ul
This command is the OSS equivalent of the preceding command:
ld file1.o file2.o -o lib -ul
Note. You can link only linkfiles into a user library. You cannot link loadfiles, or a
combination of loadfiles and linkfiles, into a user library.