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: Fri, 3 Aug 2018 22:20:13 -0400

I dug into the cobcrun code and saw they were copying the COB_LIBRARY_PATH into a separate environment.

I coded that in my .c file _something_ like this:

   (void) cob_setenv ("COB_LIBRARY_PATH", getenv("COB_LIBRARY_PATH"), 1);
   (void) cob_setenv ("COB_PRE_LOAD", "UNDATE", 1);

   LibHandle = dlopen("MYPROG.so", RTLD_NOW);

   cob_init();  // Added per James' suggestion.

   ProgramEntry = (ProgramEntryType)dlsym(LibHandle, "MYPROG");

   ProgramEntry();

If anyone has a good idea of what I should change please speak up.  If I don't hear anything I will code up a minimal test case and post it.

One issue I have with James' suggestion is it seemed to imply that I needed to do cob_init() after dlopen, but will I need to do a dlopen before every cobol call.

My code is structured such that c calls COBOL calls c calls COBOL calls c ....




On Fri, Aug 3, 2018 at 3:12 PM James K. Lowden <address@hidden> wrote:
On Wed, 1 Aug 2018 23:21:44 -0400
Michael Potter <address@hidden> wrote:

> 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.

Are you calling cob_init after dlopen and before calling any cobol
function? 

I would expect COB_LIBRARY_PATH to affect the Cobol runtime support,
not cobcrun per se. 

--jkl



reply via email to

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