Hi,
In server express we are using "cob32 -C nolist -vz EDMS_Service.o" command for compilation and .so file is getting generated also successfully executed through COBOL.
Now in Visual COBOL
we tried to generate .so file using below 2 commands with both the command COBOL is not able to load .so getting error code =198.
cob64-C nolist -vz EDMS_Service.o --> With this file is getting generated without .so extension.
cob -xve "" -o EDMS_Service.so -C xopen EDMS_Service.o --> With .so file is getting generated but while execution getting load error =198.
Can please help us with command to get correct .so file ?
Hi Sanjay Singh,
The 198 error indicates that the runtime system could not load a module. This may be because the module is not found, or is located but is somehow invalid. I notice that in Server Express, you were running the 32 bit version of the cob command (cob32) to build your .so, whereas in Visual COBOL, you've tried the 64 bit version (cob64). Has the EDMS_Service.o C module been rebuilt (for the system running Visual COBOL) as 64 bit? You can confirm this by running the file command against the .o file. Here's an example of doing this:
$ file csub1.o
csub1.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
That example shows that csub1.o is a 32 bit module. What does the file command reveal about your .o file?
Also, can you provide a little more background about the environment. What version of Visual COBOL are you using. One way to reveal this at a Unix/Linux prompt is with the command: "cob -V", where the flag specified is an upper case V. Please reply with the complete output of this command.
It may also help to know what Operating System and Version are you using with Visual COBOL, and on which platform? For example, this might be something like "Red Hat Enterprise Linux 8.4 on x86-64".
Hi Sanjay Singh,
The 198 error indicates that the runtime system could not load a module. This may be because the module is not found, or is located but is somehow invalid. I notice that in Server Express, you were running the 32 bit version of the cob command (cob32) to build your .so, whereas in Visual COBOL, you've tried the 64 bit version (cob64). Has the EDMS_Service.o C module been rebuilt (for the system running Visual COBOL) as 64 bit? You can confirm this by running the file command against the .o file. Here's an example of doing this:
$ file csub1.o
csub1.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
That example shows that csub1.o is a 32 bit module. What does the file command reveal about your .o file?
Also, can you provide a little more background about the environment. What version of Visual COBOL are you using. One way to reveal this at a Unix/Linux prompt is with the command: "cob -V", where the flag specified is an upper case V. Please reply with the complete output of this command.
It may also help to know what Operating System and Version are you using with Visual COBOL, and on which platform? For example, this might be something like "Red Hat Enterprise Linux 8.4 on x86-64".
Hi,
Issue is resolved.
We have followed below step to compile .c and building .so file.
To generate .o from .c use below command
gcc -fPIC src/EDMS_Service.c -c -o EDMS_Service.o
To generate .so from .o use below command
cob64 -C nolist -vz EDMS_Service.o
Hi,
Issue is resolved.
We have followed below step to compile .c and building .so file.
To generate .o from .c use below command
gcc -fPIC src/EDMS_Service.c -c -o EDMS_Service.o
To generate .so from .o use below command
cob64 -C nolist -vz EDMS_Service.o
Great, thanks for responding and sharing the resolution.