1ST PROBLEM
In Ubuntu 20.04 LTS under a structure like this:
/home/sysadmin/GnuCOBOL/app (program files *.cob)
/home/sysadmin/GnuCOBOL/bin (binary files and *.so)
/home/sysadmin/GnuCOBOL/cpy (copy files *.cpy)
/home/sysadmin/GnuCOBOL/fil (files *.idx and *.dat)
/home/sysadmin/GnuCOBOL/tmp (temporary files)
Compiler GnuCOBOL 2.2 a "COPY" sentence I can reference it with relative path:
INPUT-OUTPUT SECTION.
FILE-CONTROL.
COPY "../cpy/select_customers".
DATA DIVISION.
FILE SECTION.
COPY "../cpy/fd_customers".
However compiler GnuCOBOL 3.1.2 a "COPY" sentence I must reference it with full path:
INPUT-OUTPUT SECTION.
FILE-CONTROL.
COPY "/home/sysadmin/GnuCOBOL/cpy/select_customers".
DATA DIVISION.
FILE SECTION.
COPY "/home/sysadmin/GnuCOBOL/cpy/fd_customers".
2ND PROBLEM
Compilation instruction cobc -free ../app/customers.cob works fine.
However compilation instruction cobc -x -free ../app/customers.cob shows this error:
/usr/bin/ld: /lib/x86_64-linux-gnu/libtinfo.so.6: error al añadir símbolos: DSO missing from command line
collect2: error: ld returned 1 exit status
Please help.
For all versions of GC when using copy books set
COBCPY= to your path i.e.,
COBCPY=/home/sysadmin/GnuCOBOL/cpy
Then you only need COPY fd_customers
It is recommended that you use the extension of .cpy for all copy books if nothing else to show clearly that they are copy book sets.
Trying to compile a copy book as a program will result in errors although that error response is surprising.
Bye the bye there are other environment vars you can use so look at the programmers guide but here are mine :
There are others not used in this environ set.
Last edit: Simon Sobisch 2021-05-15
Forgot to mention this report of a possible BUG should be documented in the Bug reporting area as it is not a feature request !
However I am seing it as a bug but it appears as a Feature request @Simon ?
Bug at SF may be ?
Last edit: Vincent (Bryan) Coen 2021-05-15
Ticket moved from /p/gnucobol/feature-requests/401/
For the first issue: I think 2.2 and 3.1 should behave quite identical and support relative paths. But: those relative paths are all to the include directories (see
cobc --infofor the current default from the environment) plus-Iparameters.It could be that 2.2 auto-includes
-I .but 3+ doesn't (I'd have to check to be sure), you may want to try-I .and check if your relative reference in theCOOYstatement works as it did before.In general it is highly suggested to never use an explicit full path in the source itself, but specify it via
-Iand/or the environment variables.In general I think "issue 1" is neither a bug, nor a feature request, more a "help request" solved by those points.
Second 2 looks like a bug, please do
and we'd have a better clue what this is about.
@alphastation: please drop an update as requested, otherwise we can't go on with this issue. Thanks"
@alphastation: Any update here?
Closed because missing response, I'm fine to reopen that as soon as we know more about that.