Operating System - HP-UX
1833788 Members
2599 Online
110063 Solutions
New Discussion

Linking Shared Library at run time

 
seema_rj
Occasional Contributor

Linking Shared Library at run time

Hi,

I am a new comer to cobol. I have a query. Can any1 plz suggest how to link shared libraries at run time? i have an executeable 'post' for which i want to link a method 'Binmup' that is defined in a shared library libmup.sl. I can link this libmup.sl during compiling post program. Bt i dnt want to compile post program everytime i make change to libmup.sl so can any1 suggest how to link libmup.sl with out compiling post program.....i am using cobol program on HP-UX

Thanx in advance

3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: Linking Shared Library at run time

I'm not sure how MF COBOL does it but the Standard has a call identifier syntax where you can put the name of the program in your identifier.

You'll need to read your MF documentation to see how to find your shared lib.

>I didn't want to compile post program every time I make change to libmup.sl

For languages like C, you can just change libmup.sl and run your application. Of course if you want to call new functions in libmup.sl, you would have to edit your application, or use dynamic loading and indirect calls.
seema_rj
Occasional Contributor

Re: Linking Shared Library at run time

Ya thanx...i cracked this issue using shl_load which will explictly load the shared libraries at run time...ya i was adding new programs to libmup.sl and everytime i dont wanted to compile post program...is it necessary for me to unload the shared libary after my excution using shl_unload() or does it happens once the program is terminated?
Dennis Handly
Acclaimed Contributor

Re: Linking Shared Library at run time

>is it necessary for me to unload the shared library after my execution using shl_unload() or does it happens once the program is terminated?

It is automatic on termination or exec.