Previous Topic Next topic Print topic


Compiling and Linking of Programs That Are to Be Used As Fetchable Procedures

On UNIX/Linux, mfplx and ldpli support two synonymous options, -dll and -so on all platforms. To compile a program to be used as a fetchable procedure, enter the command:

mfplx -dll -defext -pic myfetch.pli

or

mfplx -so -defext -pic myfetch.pli
Tip: On UNIX/Linux, when compiling a program to be used as a fetchable procedure, use the -pic compiler option.

If your fetchable program contains a subroutine, the syntax is:

mfpli -defext -pic suba.pli -o suba.obj
mfplx -dll -defext -pic myfetch.pli suba.obj  -o MYFETCH.so

Use the appropriate output extension compiler option for your operating system (-dll or -so).

You can use the -dll or -so options with the ldpli command as shown:

ldpli -so myfetch.obj suba.obj -o MYFETCH.so

The output executable image is in upper case. By default, Open PL/I generates uppercase external references. For example, the source statement in a main program fetch myfetch; searches for the executable MYFETCH.so. If linked as myfetch.so (lower case), it is not found and ONCODE 9250 is triggered.

Note: The compiler options -mvs, -ims, -cics should only be used for the OPTIONS(MAIN) programs. The use of -dll or -so indicates that it is a dynamically linked called subroutine.
Previous Topic Next topic Print topic