Upgrading Net Express program - part 2

Chris

Using the command line batch files the source code compiles and (apparently) links OK ....

c:\WORKAREA\Eloq-BOM\BOMPROG>compile
Micro Focus COBOL
Version 6.0 (C) Copyright 1984-2020 Micro Focus or one of its affiliates.
Object file-name [BOMP.OBJ]:
Source listing [NUL]:
Object listing [NUL]:
* Checking complete with no errors - starting code generation
* Generating bomp
* Data: 6912 Code: 6873 Literals: 3792
c:\WORKAREA\Eloq-BOM\BOMPROG>link
Micro Focus COBOL - CBLLINK utility
Version 6.0.0.69 (C) Copyright 1984-2020 Micro Focus or one of its affiliates.

Microsoft (R) Incremental Linker Version 14.16.27035.0
Copyright (C) Microsoft Corporation. All rights reserved.

bomp.obj
cbllds00003FE8.obj
Creating library bomp.lib and object bomp.exp
Microsoft (R) Manifest Tool
Copyright (c) Microsoft Corporation.
All rights reserved.

... but when I try to run BOMP.EXE I get the error message "The ordinal 75 could not be located in the dynamic link library c:\workarea\eloq-bom\bomprog\image3kc.dll"

I don't recall ever seeing this error message before. Can you shed any light on this?

Thanks

  • c:\workarea\eloq-bom\bomprog\image3kc.dll must be a 3rd party program that you are calling.
    The error message is basically saying that you are trying to call an entry point which cannot be located.

    How are you loading this .dll from your application?
    Are you linking in an import library for this .dll, i.e. image3kc.lib perhaps?
    Or are you calling it from your application, CALL "image3kc" ...
    Or are you loading it using the INITCALL directive? $SET INITCALL"image3kc"
    Or by using a procedure-pointer? set pp to entry "image3kc"

     

     

  • Chris:

    I have:

    Data Division:    01 pp procedure-pointer.

    Proc Division:    set pp to entry " image3kc"

     

  • Is the error occurring on this set procedure-pointer statement or is it occurring on a call statement later on?

    There may be something wrong with the 3rd party .dll or perhaps one of its dependencies is missing?
    Are you compiling for 32-bit or 64-bit?

    I found the following article on using this Eloquence .dll which references MF COBOL and seems to indicate that you must use the directive:

    MAKESYN "COMP-5" = "COMP"

     Are you using the same compiler directives that you used with Net Express?, i.e COBOL.DIR file?

     

  • Chris

    The compile and link batch files are thus:

    compile bat: cobol bomp.cbl anim case litlink makesyn "comp-5"="comp" omf(obj)

    link.bat: cbllink bomp.obj image3kc.lib

    I'm compiling to 32.bit. I don't recall having a COBOL.DIR file with NX5.

    I placed copies of image3kc.dll and image3kc.lib in the same directory as my source file  when I developed this application several years ago and never had the 'ordinal' problem. (You may not recall it but you were instrumental in helping solve the compilation problems I was having. ) If I delete the .dll and .lib copies in my source folder and use the standard Eloquence set up i.e. use the.lib and .dll  in the Eloquence \bin folder I get this:

    Microsoft (R) Incremental Linker Version 14.16.27035.0
    Copyright (C) Microsoft Corporation. All rights reserved.

    bomp.obj
    cbllds0000139C.obj
    LINK : fatal error LNK1181: cannot open input file 'image3kc.lib'

    So using the Eloquence 'standard' set up will not link. Using copies in my source folder completes the link but running bomp.exe gives the ordinal error.

    The only references to image3kc in my program are

    Data Division: 01 pp procedure-pointer.

    Proc Division: set pp to entry " image3kc"

    There is no CALL statement.

     

     

  • As you are using the litlink directive the

    set pp to entry " image3kc"

    will be resolved using imagek3c.lib by the linker. That is why you got the linker error when you deleted the .lib file. From the error, and the fact that you said that there are no call statements, it suggests that the .lib file references ordinal 75 in imagek3c.dll for the entry 'image3kc' and if there is no ordinal 75 exported from the dll that error will occur which would imply that the .lib was for a different version of the .dll  than the one that is being loaded.

    You can look at the exported names and ordinal values for the dll by running

    link -dump -exports imagek3c.dll

    An alternative to try is removing the litlink directive. If you do that the set pp ... statement will be handled by the run-time system at the point at which it is called rather than when it is linked. 

  • Verified Answer

    Gael (and Chris)

    The source directory that I was using was a copy of the original from a few years ago and included the .dll and .lib from a previous version of Eloquence. I therefore copied the image3kc.dll and .lib from the Eloquence \bin and \lib folders to my source directory and recompiled and linked the program, exactly as I had done before. After starting the eloqdb service, running my program executed perfectly.

    I noticed that the creation dates on the 'new' .dll and .lib files were from 2019 (whereas the originals I was using were from 2010) so maybe something was changed between versions.

    Anyway, everything works fine at the moment.

    Thanks for your patience and suggestions.