Menu

Cannot locate CBL_ routine running exe

2 days ago
21 hours ago
  • Vince Esparza

    Vince Esparza - 2 days ago

    Hello, This is probably a very simple question but I have not had to do this. I created an EXE (cobc -x pgm.cbl). It calls a CBL_ routine (could be CBL_GC or something else). When I run the exe I get libcob: error: module 'CBL_GC_RANDOM' not found. I have COB_LIBRARY_PATH=c:\oc\lib;c:\oc\include. This is running under Win 11 and I have been using R3.2.0 for a few years now. The banner says: Built Jul 28 2023 19:10:09 Packaged Jul 28 2023 17:02:56 UTC. But I am certain I just need to point to some directory or download some files. I started with gnucobol-3.2_win.7z, unzipped it, set a bat file to point to it and have been fine until now. What am I missing? Because it never complained when creating the EXE, but it does when running it. Thanks, Vince

     
    • Simon Sobisch

      Simon Sobisch - 2 days ago

      CBL_routines are (commonly) in-built, you can list them with cobc --list-system - there is no RANDOM one in there as COBOL since the COBOL85 Amendments has FUNCTION RANDOM.

      If you have an external library like the one from Chuck and it includes such entry, then you either have to use COB_PRE_LOAD to pre-load the extension library or link object file (or the library or compile the C source together with COBOL while also using static calls) when you compile the program that uses the extension routine (I highly suggest to use the preload option for extension libraries).

       
      • Vince Esparza

        Vince Esparza - 21 hours ago

        Thanks Simon!  I will rewrite my source. The code came from  https://www.codeconvert.ai/cobol-code-generatorThey produce lots of semi-useful code, but I almost always have to re-do it because they do things like use the FD for I/O.         
        On Tuesday, September 22, 2026 at 02:00:05 PM EDT, Simon Sobisch sf-mensch@users.sourceforge.net wrote:

        CBL_routines are (commonly) in-built, you can list them with cobc --list-system - there is no RANDOM one in there as COBOL since the COBOL85 Amendments has FUNCTION RANDOM.

        If you have an external library like the one from Chuck and it includes such entry, then you either have to use COB_PRE_LOAD to pre-load the extension library or link object file (or the library or compile the C source together with COBOL while also using static calls) when you compile the program that uses the extension routine (I highly suggest to use the preload option for extension libraries).

        Cannot locate CBL_ routine running exe

        Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gnucobol/discussion/help/

        To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

         

Anonymous
Anonymous

Add attachments
Cancel