My goal is to call a C++ function from COBOL. I am using a V3 Fujitsu Cobol compiler for students.
My sample COBOL code, sample.cob looks as below:
000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. 'HELLO WORLD'.
000030 ENVIRONMENT DIVISION.
000040 DATA DIVISION.
000041 WORKING-STORAGE SECTION.
000043 01 parameters.
000044 02 InputString PIC X(19).
000050 PROCEDURE DIVISION.
000061 CALL "MYFUNCTION" WITH C LINKAGE USING BY REFERENCE InputString.
000070 DISPLAY 'HELLO WORLD'.
000080 STOP RUN.
MYFUNCTION is the exported function from MYFUNCTION.dll . I am trying to call this function from my cobol program.
1. I compiled the COBOL code with the compiler options of NOALPHAL, DLOAD, MAIN.
2. Linked the COBOL code with the MYFUNCTION.lib.
3. Made the entry definition in the COBOL85.CBR as MYFUNCTION=MYFUNCTION.DLL
4. But when I try to execute my cobol program, it prompts "JMP0015I-U CANNOT CALL PROGRAM "MYFUNCTION'. PGM=SAMPLE ADR 004011C6".
I am a beginner to COBOL. Can anyone please let me know, how to solve this problem. I greatly appreciate your help in this regard. Expecting your earliest reply. Thank you in advance.