F. ABF Architecture : Linking with Libraries
 
Share this page                  
Linking with Libraries
ABF uses a fixed set of libraries to link all applications. If your procedures require special libraries, add more libraries. ABF has a facility that allows you to designate a linker option file, which is included in the link.
You can do this in either of the following ways:
Enter the name of the link options file in the Applications Default window
Set the ING_ABFOPT1 logical/environment variable to the name of your link options file
If you set both values, the file name in the Applications Default window takes precedence.
Windows:
For example, if your procedure requires a library called userlib, you can create a file called myabf.opt as your own ABF linker option file. This file contains the full pathname for userlib:
c:\lib\userlib
Set the environment variable ING_ABFOPT1 to this pathname, as follows:
set ING_ABFOPT1=c:\lib\myabf.opt
When you image your application, ABF links in the library userlib.
Alternatively, you can specify c:\lib\myabf.opt as the link options filename in the Application Defaults window.
To add another library, for example c:\lib\newlib, you can modify myabf.opt. The file format for myabf.opt requires a single library or object module per line, as follows:
c:\lib\userlib
c:\lib\newlib
Because it is still set to myabf.opt, it is not necessary to change the link options file name in the Application Defaults window or redefine ING_ABFOPT1. Your application is now linked with both userlib and newlib.
UNIX:
For example, if your procedure requires a library called userlib, you can create a file called myabf.opt as your own ABF linker option file. This file contains the full pathname for userlib:
/usr/local/lib/userlib
Set the environment variable ING_ABFOPT1 to this pathname, as follows:
C shell:
% setenv ING_ABFOPT1 /usr/local/lib/myabf.opt
Bourne shell:
$ ING_ABFOPT1 = /usr/local/lib/myabf.opt
$ export ING_ABFOPT1
When you image your application, ABF links in the library userlib.
Alternatively, you can specify "/usr/local/lib/myabf.opt" as the link options filename in the Application Defaults window.
To add another library, for example, "/usr/local/lib/newlib," you can modify myabf.opt. The file format for myabf.opt requires a single library or object module per line, as follows:
/usr/local/lib/userlib
/usr/local/lib/newlib
Because it is still set to myabf.opt, it is not necessary to change the link options file name in the Application Defaults window or redefine ING_ABFOPT1. Your application is now linked with both userlib and newlib.
VMS:
If your application uses a C procedure, you must link the application to the VAX C Runtime Library (VAXCRTL). Create a file that names this library and any other object modules to be included.
The file must be a VMS Linker option file and must have the extension .opt; for example, myabf.opt. The file myabf.opt contains the following line:
SYS$SHARE:VAXCRTL/SHARE
Define the logical name ING_ABFOPT1 as the full directory specification and filename of the file myabf.opt:
$ define ING_ABFOPT1 "dir_spec myabf.opt"
When you link your application, ABF links it with the VAX C Runtime Library. If you later decide that one of your procedures requires another library--called, for example, userlib--you can add it to myabf.opt. Place each single library or object module on a separate line. The file now contains the following lines:
SYS$SHARE:VAXCRTL/SHARE
dir_spec userlib/library
Include the string /library after the name of each library included in the option file.
Because it is still set to myabf.opt, it is not necessary to change the link options file name in the Application Defaults window or redefine ING_ABFOPT1. Your application is now linked with both the VAXCRTL and userlib.
For more discussion of linking with libraries, see Creating an Image of the Application.