Menu

entry point not found error

2021-07-25
2021-07-26
  • Alan Darlington

    Alan Darlington - 2021-07-25

    I created a program hellow.cob:

        id division.
           program-id. hellow.
           ENVIRONMENT DIVISION.
           CONFIGURATION SECTION.
           REPOSITORY.
               FUNCTION hello
               FUNCTION ALL INTRINSIC.
           data division.
           working-storage SECTION.
           01  ws-dummy    pic x.       
           procedure division.
               display 'calling hello'.
               call 'hello' using ws-dummy.
               display 'returned from hello'.
    

    and a subroutine hello.cob:

           id division.
           FUNCTION-ID. hello.
           data division.
           LINKAGE SECTION.
           01 lk-dummy    pic x.
           01 lk-dummy2   pic x.        
           procedure division using lk-dummy RETURNING lk-dummy2.
               display 'from subroutine -- hello world!'.
               end FUNCTION hello.
    

    Both compile successfully giving hellow.exe & hello.dll (using -x & -m options for cobc) in c:\ gnucobol.
    When I execute hellow.exe from \gnucobol I get:

    calling hello
    libcob: error: entry point 'hello' not found
    

    What have I not done or done wrong?

    I installed gnucobol using Arnold Trembley's process for Windows with ISAM.

     

    Last edit: Simon Sobisch 2021-07-26
    • David Wall

      David Wall - 2021-07-26

      What's the FUNCTION-ID. hello. in the .dll - shouldn't that be Program-id. hello. ??.

       
  • Simon Sobisch

    Simon Sobisch - 2021-07-26

    As David pointed out: either use PROGRAM-ID and CALL or FUNCTION-ID and use a function (note: in the later case: ensure that you either COB_PRE_LOAD the dll or have it all upper-case).

     

Anonymous
Anonymous

Add attachments
Cancel