/usr/bin/ld: cannot find -lnsl



/usr/bin/ld: cannot find -lnsl

I do not know what to do to fix it. Any resonable suggestions?

I added last two lines to /etc/ld.so.conf

# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/X11R6/lib
/usr/lib/qt3/lib
/usr/lib
/lib

I tried creating soft link in /lib
ln -s libnsl-2.3.5.so libnsl.so

# echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
LD_LIBRARY_PATH=


Logged out/in again as root.


# locate libnsl
/usr/lib/libnsl.so
/lib/libnsl-2.3.5.so
/lib/libnsl.so.1
/lib/libnsl.so


Long lines reformated in this post with \

# dir /usr/lib/libnsl.so
lrwxrwxrwx 1 root root 21 Jan 20 16:50 \
/usr/lib/libnsl.so -> ../../lib/libnsl.so.1
# cd /usr/lib/
# dir ../../lib/libnsl.so.1
lrwxrwxrwx 1 root root 15 Jan 20 16:50 \
../../lib/libnsl.so.1 -> libnsl-2.3.5.so
# cd ../../lib/
# dir *libnsl*
-rwxr-xr-x 1 root root 68,576 Aug 30 2005 libnsl-2.3.5.so
lrwxrwxrwx 1 root root 15 Jan 20 16:50 libnsl.so.1 -> libnsl-2.3.5.so


Runing Mandriva Linux 2006.0 Official, all updates applied.
# gcc -v
Using built-in specs.
Target: i586-mandriva-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib \
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info \
--enable-shared --enable-threads=posix --disable-checking \
--enable-languages=c,c++,ada,f95,objc,java \
--host=i586-mandriva-linux-gnu --with-system-zlib --enable-long-long \
--enable-__cxa_atexit --enable-clocale=gnu \
--disable-libunwind-exceptions --enable-java-awt=gtk \
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre \
--enable-gtk-cairo --disable-libjava-multilib \
Thread model: posix
gcc version 4.0.1 (4.0.1-5mdk for Mandriva Linux release 2006.0)

# ld -v
GNU ld version 2.16.91.0.2 20050720


Trying to compile the samhain file integrity/intrusion detection system
as root.
<http://la-samhna.de/samhain/s_documentation.html>

# make
gcc -O -static -o samhain samhain.o sh_unix.o sh_utils.o sh_error.o \
sh_files.o sh_getopt.o sh_readconf.o sh_tiger0.o sh_tiger1.o \
sh_tiger2.o sh_tiger1_64.o sh_ tiger2_64.o sh_hash.o sh_mail.o \
sh_mem.o sh_entropy.o sh_forward.o sh_modules.o sh_utmp.o sh_kern.o \
sh_suidchk.o sh_srp.o sh_fifo.o sh_tools.o sh_html.o sh_gpg.o \
sh_cat.o sh_calls.o sh_extern.o sh_database.o sh_err_log.o \
sh_err_console.o sh _err_syslog.o sh_schedule.o bignum.o trustfile.o \
rijndael-alg-fst.o rijndael-api -fst.o slib.o zAVLTree.o sh_socket.o \
sh_ignore.o sh_prelude.o sh_mounts.o sh_use rfiles.o sh_prelink.o \
sh_static.o sh_prelude_old.o -lnsl -lnsl -lresolv

/usr/bin/ld: cannot find -lnsl
collect2: ld returned 1 exit status
.



Relevant Pages

  • XFS filesystem
    ... I can not remove a directory, even as root. ... 2.6.0-test9 debian source package compiled with gcc 3.3.2 ... It was a 'mondo' directory made when the host was running the ...
    (Debian-User)
  • Re: Error compiling buildworld
    ... gcc version 4.2.1 20070719 ... if I commented all ccache flags in make.conf an .cshrc's root, ... (note that I really make a strong verification about ccache use; ... *** Error code 1 ...
    (freebsd-stable)
  • Re: Why is LD_LIBRARY_PATH unset in FC6 and not in FC5
    ... root has special precautions about prepended library paths. ... This makes for an easily relocatable rpm, because the rpm can drop a text file in there that points to wherever the rpm has been located. ... I'm a normal user (not root) and I'm creating software for my own use. ... This environment variable may have changed names with newer versions of gcc. ...
    (Fedora)
  • Re: get current user name?
    ... >> basically to check if the user is logged in as root and if not, exit ... > You call GetUserName, ... # gcc foo.c ...
    (comp.lang.c)
  • Re: Segmentation fault - interesting problem with array
    ... I am using Mandriva Linux 9.2 and gcc. ... After this it is giving Segmentation fault. ...
    (comp.lang.c)