Problem:
Operating System: SuSE LINUX 10 (SLES 10)
Product Verson: Server Express 5.0
cob -x tictac.cbl
ld: cannot find -lgcc
Resolution:
The file $COBDIR/etc/cobopt includes a line like this:
set GCC_LIB=/usr/lib/gcc-lib/i586-suse-linux/3.3.3
This sets the environment variable GCC_LIB, which is later used by the "cob" command in cooperation with the file $COBDIR/lib/liblist, at the time "cob" creates an executable by invoking the "ld" linker. If there is no file named "libgcc.a" in the $GCC_LIB directory at this time, then the error occurs: "ld: cannot find -lgcc".
Check to see if the file libgcc.a is in the location path that is set by the GCC_LIB environment variable.
To determine which gcc version is active on a system, check in /user/bin for all files beginning with gcc, for example:
cd /usr/bin
ls -l gcc*
If more than one version is installed, then the "gcc" file itself might be a link to another executable named, for example, "gcc296" or "gcc333". Enter "/usr/bin/gcc -v" to see the version number.
Also ensure there is no trailing spaces at the end of the "set GCC_LIB" line in the $COBDIR/etc/cobopt file.