DLL Programmer's Guide for TNS/R Systems
Sample Sessions and Usage Notes
DLL Programmer’s Guide for TNS/R Systems—522203-002
6-6
Sample Session Two
0 warnings were issued during compilation.
0 errors were detected during compilation.
Object file: mystro
Compiler statistics
phase CPU seconds elapsed time file name
NMC \DLLQA.$SYSTEM.SYSTEM.NMC
CFE 0.3 00:00:01 \DLLQA.$SYSTEM.SYSTEM.CFE
UGEN 0.1 00:00:00 \DLLQA.$SYSTEM.SYSTEM.UGEN
AS1 0.0 00:00:00 \DLLQA.$SYSTEM.SYSTEM.AS1
total 0.4 00:00:02
All processes executed in CPU 03 (NSR-G)
Swap volume: \DLLQA.$SYSTEM
Build the DLL and the Program
PIC must be built using the new linker, ld, not nld.
First we build the DLL, then the main executable file called revstr. It has to be in that
order because the main could not refer to a DLL that did not yet exist.
Note that the - l option references the DLL called mystrdll. (In Session Three we show
the main built without reference to a DLL. We use rld to load it dynamically.)
Note that the PIC format variant of CRTLMAIN is named CCPPMAIN. See the note on
CRTLMAIN and CCPPMAIN Files in the Usage Notes section.
Note the export_all option. We could also individually reference the items to be
exported, as follows:
-export MyStr_Version -export StrRev
Note the -shared option sent to ld. This creates the DLL. The -dll option can be used
to do the same task, and is probably more descriptive of what we want to achieve.
Either option can be used.
The following command creates the DLL:
ld mystro -o mystrdll -obey $SYSTEM.SYSTEM.libcobey -L $OSS.NSKAPAT2 -shared
-export_all
LD (T0429G09 - 30APR2003)
(C)2003 Hewlett Packard Development Company, L.P.
T0429's command line: mystro -o mystrdll -obey $SYSTEM.SYSTEM.libcobey -L
$OSS.NSKAPAT2 -shared -export_all
LD INFORMATIONAL MESSAGE **** [40056]:
Entering OBEY file '$SYSTEM.SYSTEM.libcobey'.
LD INFORMATIONAL MESSAGE **** [40057]:
Exiting OBEY file '$SYSTEM.SYSTEM.libcobey'.
LD INFORMATIONAL MESSAGE **** [40052]:
'-export_all' specified
LD INFORMATIONAL MESSAGE **** [40063]:
Creating a DLL and -dllname was not specified; using 'mystrdll' as
-dllname value.
LD INFORMATIONAL MESSAGE **** [40049]: