I am trying to build a C program using static flag (linking statically ). While I am trying to do so linker throws an error "can't find library for -lc". Machine I am using is HP-UX. I am unaware which library it requires and where I can find it so that I can include the default search location while building the program with -L option.
avotclbh:/home/akhils/test_prog#
avotclbh:/home/akhils/test_prog#gcc -v
Using built-in specs.
Target: ia64-hp-hpux11.31
Configured with: ../gcc/configure
Thread model: posix
gcc version 4.2.3
You have mail in /var/mail/root
avotclbh:/home/akhils/test_prog#
avotclbh:/home/akhils/test_prog#gcc -v -static test_debugging.c -o test_debugging.out -L/usr/lib/hpux64
Using built-in specs.
Target: ia64-hp-hpux11.31
Configured with: ../gcc/configure
Thread model: posix
gcc version 4.2.3
/usr/local/libexec/gcc/ia64-hp-hpux11.31/4.2.3/cc1 -quiet -v test_debugging.c -quiet -dumpbase test_debugging.c -auxbase test_debugging -version -o /var/tmp//ccjCisnQ.s
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3/../../../../ia64-hp-hpux11.31/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3/include
/usr/include
End of search list.
GNU C version 4.2.3 (ia64-hp-hpux11.31)
compiled by GNU C version 4.2.3.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 207e4f838aed34ece15d2a59ed6e0ca7
/usr/local/bin/as -x -o /var/tmp//cceZpXhF.o /var/tmp//ccjCisnQ.s
/usr/local/libexec/gcc/ia64-hp-hpux11.31/4.2.3/collect2 -z +Accept TypeMismatch -u main -noshared -o test_debugging.out crt0.o /usr/lib/hpux32/unix98.o -L/usr/lib/hpux64 -L/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3 -L/usr/ccs/lib -L/usr/local/lib/gcc/ia64-hp-hpux11.31/4.2.3/../../.. /var/tmp//cceZpXhF.o -lgcc -lc -lgcc
**ld: Can't find library for -lc
Fatal error.
collect2: ld returned 1 exit status**
avotclbh:/home/akhils/test_prog#
Also, I have below dependencies already installed on machine
avotclbh:/home/akhils/test_prog#swlist -l product |grep -iE "gcc|zlib|libiconv|gettext"
gcc 4.2.3 gcc
gettext 0.19.5.1 gettext
libiconv 1.14 libiconv
zlib 1.2.8 zlib
avotclbh:/home/akhils/test_prog#