rld Manual

RLD Manual528857-006
2-1
2 Using the rld Loader Library
You can load, use, and manage DLLs dynamically by using these run-time linking
functions from the rld loader library:
dlopen() opens and loads a DLL dynamically from within your application.
dlsym() accesses the symbols of a dynamically-loaded DLL.
dlclose() closes a DLL loaded previously by dlopen().
dlresultcode() returns the error code for the most recent call to dlopen(),
dlclose(), or dlsym().
dlerror() obtains text associated with an error returned previously by
dlresultcode().
These functions are declared in a header file called dlfcn.h and defined in the loader
library. Therefore, any C or C++ source file that uses these functions must contain the
following:
#include <dlfcn.h>
The same functions have pTAL external declarations in a file named hdlfcn. Both
header files also define parameter types and constants for use with these functions.
These functions are implemented in the public library ZRLDSRL on TNS/R and
ZRLDDLL on TNS/E systems. This library is not named in LIBCOBEY or libc.obey (if
one exists) and is not supplied automatically by the compiler driver when it runs the
linker for you. Therefore, you must name this library explicitly when building a loadfile
that calls any of these functions. If you run the linker manually, you can add a -lib
zrldsrl or -lib zrlddll option in the command stream. If you let the compiler
run the linker, you can provide the option through the compiler command line.
This support is provided as a 32-bit interface on both TNS/R and TNS/E. Additionally,
the support is provided as a 64-bit interface on TNS/E from the H06.24/J06.13 RVUs
onward.