LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Trying to compile iputils package statically and getting error (https://www.linuxquestions.org/questions/programming-9/trying-to-compile-iputils-package-statically-and-getting-error-831883/)

manya 09-13-2010 08:36 AM

Trying to compile iputils package statically and getting error
 
I am trying to compile the iputils package on FC12 statically but badly stuck up on a below error.
My requirement is; I need to have ping utility built statically.

Any clue whats missing here? Per my understanding its trying to locate the glibc and when I search for glibc rpm I can see all those packages are properly installed.

###################################
[root@bastionNUX iputils-s20100418]# make LDFLAGS="-static -s"
gcc -static -s ping.o ping_common.o -o ping
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
make: *** [ping] Error 1

####################
[root@bastionNUX iputils-s20100418]# rpm -qa | grep glibc
glibc-common-2.11-2.i686
glibc-headers-2.11-2.i686
glibc-devel-2.11-2.i686
glibc-2.11-2.i686
[/B]

JohnGraham 09-13-2010 08:59 AM

Quote:

Originally Posted by manya (Post 4096022)
/usr/bin/ld: cannot find -lc

Looks like you don't have a static C library in your linker's search path. Try running `whereis libc` or `locate libc.a` and see if there's a file called libc.a anywhere on your system. If not, have a hunt through whatever package management system Fedora has.

knudfl 09-13-2010 09:40 AM

The static "libc.a" ( = lc ) is in a separate package :

# yum install glibc-static

...

manya 09-13-2010 09:42 AM

yeah looks like I dont have libc.a but I guess glibc-devel package does provide that and when I do rpm query I can see its listed there.

knudfl 09-13-2010 05:28 PM

No : rpm -ql glibc-devel | grep libc
→ no libc.a ( there's a libc_nonshared.a ).


Install 'glibc-static', then it's provided.

..


All times are GMT -5. The time now is 05:35 PM.