Welcome to the Linux Foundation Forum!

problem while running make

Hi

I am getting the below error while running make.Could you please help me to resolve this issue.

[root@localhost ]# make

gcc -static -o ../host_bin/watchdog ./watchdog.o -L ../Rlib/lib_host/ -lRhm -L ../Rlib/lib_host/ -lrtimer -lpthread

/usr/bin/ld: cannot find -lpthread

/usr/bin/ld: cannot find -lc

collect2: ld returned 1 exit status

make: *** [../host_bin/watchdog] Error 1

[root@localhost ]#

I installed fedora 14 in my system.

[root@localhost Watchdog]# uname -a

Linux localhost.localdomain 2.6.35.6-45.fc14.i686 #1 SMP Mon Oct 18 23:56:17 UTC 2010 i686 i686 i386 GNU/Linux

[root@localhost Watchdog]#

Thanks in advance.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • Posts: 501
    Well, it seems you are missing the pthread library, or it isn't in your library search path for the linker. I see you are running a 32-bit OS. Also, you are doing a static linkage. The file name of the static version of the pthread library is libpthread_nonshared.a, so try using -lpthread_nonshared instead of -lpthread on the link line.
  • Thanks very much.

    Now I am not getting the lpthred message, but still I am getting the "can not find:lc" message. Could you please tell me how to resolve it.


    [root@localhost ]# make
    gcc -static -o ../host_bin/watchdog ./watchdog.o -L ../Rlib/lib_host/ -lRhm -L ../Rlib/lib_host/ -lrtimer -lpthread_nonshared
    /usr/bin/ld: cannot find -lc
    collect2: ld returned 1 exit status
    make: *** [../host_bin/watchdog] Error 1
    [root@localhost ]#
  • Posts: 647
    You need the glibc packages (probably the dev ones)
  • Posts: 501
    Just like libpthread, libc's static link version is libc_nonshared.a, so link with -lc_nonshared instead of -lc
  • Hi,

    Sorry for the late reply.

    I tried with -lc_nonshared, but still it is showing the same error.

    [root@localhost ]# make
    gcc -static -o ../host_bin/watchdog ./watchdog.o -L ../Rlib/lib_host/ -lRhm -L ../Rlib/lib_host/ -lrtimer -lpthread_nonshared -lc_nonshared
    /usr/bin/ld: cannot find -lc
    collect2: ld returned 1 exit status
    make: *** [../host_bin/watchdog] Error 1
    [root@localhost ]#
  • Hi,

    Sorry for the late reply.

    I tried to install glibc, but it is showing that it is already installed.

    [root@localhost ]# yum install glibc
    Loaded plugins: langpacks, presto, refresh-packagekit
    Adding en_US to language list
    Setting up Install Process
    Package glibc-2.12.90-17.i686 already installed and latest version
    Nothing to do
    [root@localhost ]#

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training