bug-gnucobol
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-GnuCOBOL] Bug-GnuCOBOL Digest, Vol 17, Issue 5


From: Michael Potter
Subject: Re: [Bug-GnuCOBOL] Bug-GnuCOBOL Digest, Vol 17, Issue 5
Date: Wed, 1 Aug 2018 23:21:44 -0400

So I am reviving this old thread....

I am getting this error:
libcob: user-defined FUNCTION 'UNDATE' not found
when I attempt to load the COBOL program using my own dlopen in my own c program (I am not using cobcrun).

I suspect that COB_LIBRARY_PATH is part of cobcrun and therefore not used in my c program.

Any recommendations to get the user defined function to load using my own c program to start the COBOL program?



On Fri, Jul 6, 2018 at 8:23 PM James K. Lowden <address@hidden> wrote:
On Wed, 4 Jul 2018 22:40:44 -0400
Michael Potter <address@hidden> wrote:

> This is what I used as a prototype for what I will do in production.
>
> Note how I put the FUNCTION .so file in a different directory.
>
> The key to getting it to compile is the REPOSITORY section in foo.cbl.
>
> The key to getting it to run is pointing to that directory using
> COB_LIBRARY_PATH.

It should be possible to make FUNCTION.so available without using
COB_LIBRARY_PATH if you build the compiler yourself and don't mind
using a fixed directory. 

On most Linux systems, the shared object in loaded by ld.so, and the
default search path usually includes /usr/lib.  With the file in

        /usr/lib/FUNCTION.so

I would expect it to work without COB_LIBRARY_PATH. 

If you don't like to put your Cobol functions in the system library
path, RPATH is your friend.  You might for instance use

        /usr/local/gnu/cobol/func

To use that, RPATH is your friend.  When compiling the compiler, use

        cobol_functions=/usr/local/gnu/cobol/func
        export LDFLAGS="-Wl,-rpath -Wl,$cobol_functions"

I'm happy to experiment with a working example.  :-) 

--jkl


reply via email to

[Prev in Thread] Current Thread [Next in Thread]