Skip to main content

Problem:

A situation can exist where it is not possible to create an executable using "cob -x".   The error occurs even when testing one of the simple demonstration programs that are furnished with the product, for example:

mkdir  /tmp/test

cp  $COBDIR/demo/debug/pi.cbl  /tmp/test

cd  /tmp/test

cob -x  pi.cbl

    

The system linker "ld" reports not being able to find a library named "cobstat" or "-lcobstat".   The exact wording of the error message depends on the bit mode (whether 32 or 64), but always mentions "cobstat".   This problem is specific to HP/UX and does not occur on other UNIX variants.

Resolution:

This problem is caused by the environment variable LDOPTS being set as follows:

LDOPTS="-a shared"

This causes the system linker to search only for shared libraries (.sl), and to ignore static libraries (.a).  The linker reports not being able to find the library "cobstat", because that library exists only as $COBDIR/lib/libcobstat.a (a static library).   The problem is solved by un-setting the LDOPTS environment variable, or at least removing "-a shared" from LDOPTS.

Old KB# 7272