I am trying to Compile, assemble, and combine all cobol files into a single dll module.
There are lots of COBOL programs in the input. And would like to combine all of these to Prog1.dll (I hope the syntax is right) . Here I have not given true program names.
Another query -
Can you also tell me the cobc command/parameter to combine all the object files into one dll file. Does -b parameter also work for input object files?
Regards,
Abhijeet
Last edit: Simon Sobisch 2020-07-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That is a reasonable thing to do and a strange error you get.
First: Please ensure to use a current version - in this case the latest build from Arnold.
If you still get those errors with the latest version: please provide a minimal test set and I'll fix that.
Second: I highly suggest to not compile in any "root"/"admin" space like %ProgramFiles% or /usr/local/bin. Instead: have the sources in user space (somewhere below %USERPROFILE% or /home/) or in a separate place like a data partition.
As you use Arnold's package (possilby the heavily outdated one):
open command prompt (or powershell) in the place where your sources reside
directly call the set_env.cmd script once to set everything up
then fo your compile
Side notes:
if those sources are "IBM orginal" and you don't want to add newer features to it: you'll likely want -std=ibm-strict, not -std=ibm
if the sources are self-contained (=all CALLs targets are either in libcob [like CALL "SYSTEM" or CALL "C$GETPID"] or in the programs you combine) use -static to ensure that they are actually resolved during linking. If the generated "modules" leave into other "modules" it would be reasonable to use static linking for those that belong together by something like -K prog2 -K prog3 instead.
To your other question: object files are directly linked into the binaries, so yes: combining them will work. You can also compile the COBOL sources to object files first and then use these later to combine into your dll.
Last edit: Simon Sobisch 2020-07-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am trying to Compile, assemble, and combine all cobol files into a single dll module.
There are lots of COBOL programs in the input. And would like to combine all of these to Prog1.dll (I hope the syntax is right) . Here I have not given true program names.
after this command, I get below error
Another query -
Can you also tell me the cobc command/parameter to combine all the object files into one dll file. Does
-bparameter also work for input object files?Regards,
Abhijeet
Last edit: Simon Sobisch 2020-07-02
That is a reasonable thing to do and a strange error you get.
First: Please ensure to use a current version - in this case the latest build from Arnold.
If you still get those errors with the latest version: please provide a minimal test set and I'll fix that.
Second: I highly suggest to not compile in any "root"/"admin" space like
%ProgramFiles%or/usr/local/bin. Instead: have the sources in user space (somewhere below%USERPROFILE%or/home/) or in a separate place like a data partition.As you use Arnold's package (possilby the heavily outdated one):
set_env.cmdscript once to set everything upSide notes:
-std=ibm-strict, not-std=ibmCALLs targets are either in libcob [likeCALL "SYSTEM"orCALL "C$GETPID"] or in the programs you combine) use-staticto ensure that they are actually resolved during linking. If the generated "modules" leave into other "modules" it would be reasonable to use static linking for those that belong together by something like-K prog2 -K prog3instead.To your other question: object files are directly linked into the binaries, so yes: combining them will work. You can also compile the COBOL sources to object files first and then use these later to combine into your dll.
Last edit: Simon Sobisch 2020-07-02