FedoraForum.org - Fedora Support Forums and Community
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

    Hello all,

    I'm beginner of Linux.

    I use Fedora 16 (RedHat) 64bits. I wrote a program named hello.c. I compiled it but I got following result:
    "
    # gcc hello.c
    /usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.6.0/../../../libc.so when searching for -lc
    /usr/bin/ld: skipping incompatible /usr/lib/libc.so when searching for -lc
    /usr/bin/ld: cannot find -lc
    collect2: ld returned 1 exit status
    "

    Please help me to resolve this issue.

    Thank you very much !

  2. #2
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

    How did you install the compiler?

    BTW, this appears to be your second thread on the same topic, though it is phrased differently.

  3. #3
    Join Date
    Aug 2010
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

    Have you installed glibc or glibc-common?

  4. #4
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

    Thank all,

    I’ve just done "yum provides /usr/include/gnu/stubs.h” but I got following result:
    yum provides /usr/include/gnu/stubs.h
    Loaded plugins: langpacks, presto, refresh-packagekit
    http:.... Timeout on
    Trying other mirror.
    .......

    It didn’t stop but continues say “Trying other mirror.”

    The staffs of my university installed it before gave me my laptop so I didn’t know how did they install.

    Could you give me detail guide to solve this problem?
    (What things I have to install and how to install them?, etc)

    Thanks !

  5. #5
    Join Date
    Aug 2009
    Location
    Waldorf, Maryland
    Posts
    7,343
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

    You need the development libraries - use

    yum groupinstall "Development Libraries"

    as indicated in your other thread.

  6. #6
    Join Date
    Oct 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up Re: Error: /usr/bin/ld: cannot find -lc when compile simplest program "hello.c"

    Thank you all of you for your help !

    I installed glibc-devel.x86_64 package successfully when I did it in my office at my university but not in my room.

    Now gcc and g++ work well with hello program I said

    Sincerely

Similar Threads

  1. Replies: 8
    Last Post: 4th November 2011, 04:42 PM
  2. Eterm compile error running "make" command
    By mkatl976 in forum Using Fedora
    Replies: 5
    Last Post: 3rd November 2005, 12:10 AM
  3. Replies: 9
    Last Post: 10th June 2005, 01:04 PM
  4. Replies: 0
    Last Post: 23rd May 2005, 04:59 AM
  5. Replies: 2
    Last Post: 23rd November 2004, 07:32 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •