[clug] compiling problem

Duncan Roe duncan_roe at acslink.net.au
Wed Nov 29 11:06:30 GMT 2006


Hi Adrian,

It seems that on your system, static libc is not installed. If installed, it
would be called libc.a and reside in /usr/lib (or /usr/lib64 on a 64-bit
system). It would be a *big* file:

 21:48:39$ ls -l /usr/lib64/libc.* /usr/lib64/libc_nonshared.a
 -rw-r--r--  1 root root 66473442 2006-05-21 11:31 /usr/lib64/libc.a
 -rw-r--r--  1 root root      210 2006-05-21 11:31 /usr/lib64/libc.so
 -rw-r--r--  1 root root    85288 2006-05-21 11:31 /usr/lib64/libc_nonshared.a

libc_nonshared.a complements /lib/libc.so.n as can be seen from the contents of
/usr/lib64/libc.so:

 21:49:16$ cat /usr/lib64/libc.so
 /* GNU ld script
    Use the shared library, but some functions are only in
    the static library, so try that secondarily.  */
 OUTPUT_FORMAT(elf64-x86-64)
 GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a )

It's optional to build static libc when building glibc, looks like the authors
of your distro chose not to do it.

Building glibc from source is possible but not popular with the maintainers. The
config directives have to be just right, or it won't work in my experience.
Post again if you want to try it.

Cheers ... Duncan.


On Wed, Nov 29, 2006 at 09:37:48PM +1100, Adrian Blake wrote:
> I am trying to compile someone else's software and I get the following
> error. In this instance I cannot fathom what path to take to resolve the
> problem.
>
> error:
>
> after many warnings...
>
> /usr/bin/ld: cannot find -lc
> collect2: ld returned 1 exit status
>
>
>   the compiling direction is:
> gcc -static -O2 -g -Wall decreasoner.c -o decreasoner
>
> Just this one line
>
>
> Adrian
> --
> Adrian Blake
> Molonglo Radio Observatory
> University of Sydney
> 1152 Hoskinstown Rd
> Bungendore 2621
> ph. 02 80042212  mobile 0407 232 978
>
> http://150.101.125.30
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux

--
 Please avoid sending me Word or PowerPoint attachments.
 See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the linux mailing list