Previous: Static COBOL to C, Up: C Interface


2.3.5 Dynamic linking with C programs

You can create a dynamic-linking module from a C program by passing an option -shared to the C compiler:

     $ cc -shared -o say.so say.c
     $ cobc -x hello.cob
     $ export COB_LIBRARY_PATH=.
     $ ./hello
     Hello World!