0

I am compiling some libraries which tries to check for gcc "-static" option as shown below. In RHEL6 this fails as "cannot find -lc".

[root@ ]# echo 'main(){return(0);}' > conftest.c
[root@ ]# gcc -o conftest -g -O2   -static conftest.c
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
[root@ ]#

I could not find libc.a available in the system.

How to fix this issue?

Cyrus
  • 84,225
  • 14
  • 89
  • 153
Kiran Mohan
  • 2,696
  • 6
  • 36
  • 62

1 Answers1

5

Install the glibc-static package.

Lars Brinkhoff
  • 13,542
  • 2
  • 28
  • 48