Linking COBOL psrun.mak – Error “ld: cannot find -lgcc”

When linking COBOL on RHEL Linux x86_64, depending various factors you will most likely have a different gcc library then what is specified in cobopt64 configuration file.

As root change to the $COBDIR/etc directory and modify the cobopt64 file, look for the line:

set GCC_LIB=/usr/lib/gcc/x86_64-redhat-linux/x.x.x

Set x.x.x to the latest gcc version installed on the server at:  /usr/lib/gcc/x86_64-redhat-linux/x.x.x