DLL Programmer's Guide for TNS/E Systems

Advanced DLL Facility Controls
DLL Programmer’s Guide for TNS/E Systems527252-006
5-10
Link-Time Operation
You can insert multiple -change options, where each must be followed by the name
of the affected loadfile, even if the loadfile is the same in each case. These options are
executed one at a time in the order inserted.
Your user ID must have write access to the file to execute the -change option on it.
Link-Time Operation
Running the Linker Through the Compiler
The C and C++ compilers can run the linker for you, saving you a separate step in
straightforward situations. In each case, the compiler automatically names many of the
appropriate input files and library files in the linker command stream. These are:
The usual C libraries
The usual C++ runtime libraries and cppinit module for the selected dialect version,
for C++
CCPLMAIN or ccplmain.o
The compiler does not automatically include more specialized libraries, such as those
for tools.h++, or the loader library (ZRLDDLL).
Guardian
CCOMP and CPPCOMP will run the linker when building a program, if you add the
RUNNABLE pragma to the command line. For example:
ccomp /in myprogc/ myprog; suppress,runnable,call_shared,symbols
These compiler drivers will also run the linker when building a DLL, if you use the
SHARED rather than the CALL_SHARED option. For example:
ccomp /in mylibc/ mylib;suppress,shared,symbols
This example compiles a program that uses that DLL:
ccomp /in myprog2c/ myprog2;suppress,runnable, &
call_shared,symbols,search "mylib"
The search pragma causes the “mylib” to be included in the linker command stream.
A more flexible way to add linker commands through the compiler command line is the
pragma LINKFILE. For example, suppose that you create an edit file named obeyrld
that contains one line:
-lib zrlddll
Then the following example will link a program that requires the dynamic loader library
(in addition to the usual libraries that are provided automatically):
ccomp /in mydynpc/ mydynp;suppress,runnable, &
call_shared,symbols,linkfile "obeyrld"