LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-13-2010, 08:36 AM   #1
manya
Member
 
Registered: Apr 2004
Posts: 194

Rep: Reputation: 15
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]
 
Old 09-13-2010, 08:59 AM   #2
JohnGraham
Member
 
Registered: Oct 2009
Posts: 467

Rep: Reputation: 139Reputation: 139
Quote:
Originally Posted by manya View Post
/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.
 
Old 09-13-2010, 09:40 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

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

# yum install glibc-static

...
 
Old 09-13-2010, 09:42 AM   #4
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
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.
 
Old 09-13-2010, 05:28 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

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


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

..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Missing Dependency: libsysfs.so.1 is needed by package iputils MarkEHansen Linux - General 9 09-19-2008 05:54 PM
compile wget statically iggi Linux - Software 2 11-12-2007 06:50 AM
How to compile statically? futhark Linux - Software 2 04-16-2006 01:39 PM
Can't compile MPlayer statically. Nezzo Linux - Software 3 11-04-2003 06:29 PM
How do I statically compile a src.rpm? WeNdeL Linux - General 1 05-19-2003 10:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration