I\'m trying to compile a test file:
gcc -o test test.c -lg2c
but I get the error:
/usr/bin/ld: cannot find -lg2c
Try setting LIBRARY_PATH
, instead of LD_LIBRARY_PATH
.
From the gcc
man page:
LIBRARY_PATH
The value of LIBRARY_PATH is a colon-separated list of directories, much like PATH. When configured as a native compiler, GCC tries the directories thus specified when searching for special linker files, if it can't find them using GCC_EXEC_PREFIX. Linking using GCC also uses these directories when searching for ordinary libraries for the -l option (but directories specified with -L come first).