LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   libdnet.1: cannot open shared object file: No such file or directory (https://www.linuxquestions.org/questions/linux-newbie-8/libdnet-1-cannot-open-shared-object-file-no-such-file-or-directory-4175480906/)

OtagoHarbour 10-15-2013 01:48 PM

libdnet.1: cannot open shared object file: No such file or directory
 
I am using Unbuntu 11.4. (No newer version of Ubuntu works on this old desk top.) I decided to build the latest version of Snort on this server. Ubuntu does not support "sudo apt-get install" for the latest version of Snort since this version of Ubuntu is no longer supported. Hence I downloaded a tar ball and build Snort with ./configure and make. Now it cannot find a shared library when I try to run snort. These are the messages I get.

Code:

OtagoHarbour@WebServer:~$ echo $PATH
/usr/local/lib:/home/OtagoHarbour/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
OtagoHarbour@WebServer:~$ snort -v
snort: error while loading shared libraries: libdnet.1: cannot open shared object file: No such file or directory
OtagoHarbour@WebServer:~$ ls /usr/local/lib/libdnet.1
/usr/local/lib/libdnet.1
OtagoHarbour@WebServer:~$ ls -l /usr/local/lib/libdnet.1
lrwxrwxrwx 1 root root 13 2012-08-11 21:52 /usr/local/lib/libdnet.1 -> libdnet.1.0.1
OtagoHarbour@WebServer:~$ sudo snort -v
snort: error while loading shared libraries: libdnet.1: cannot open shared object file: No such file or directory
OtagoHarbour@WebServer:~$ whereis libdnet.1.0.1
libdnet.1.0: /usr/local/lib/libdnet.1.0.1

IOW the library is in the search path but the snort executable does not find it.

colucix 10-15-2013 02:44 PM

Try to define the environment variable LDFLAGS as
Code:

export LDFLAGS='-L/usr/local/lib
/usr/local/lib is not a standard place for shared objects, therefore you have to instruct the linker to search for libraries there.

OtagoHarbour 10-15-2013 02:54 PM

Quote:

Originally Posted by colucix (Post 5046337)
Try to define the environment variable LDFLAGS as
Code:

export LDFLAGS='-L/usr/local/lib
/usr/local/lib is not a standard place for shared objects, therefore you have to instruct the linker to search for libraries there.

Thanks for replying but I still have the same problem.

Code:

OtagoHarbour@WebServer:~$ export LDFLAGS='-L/usr/local/lib'
OtagoHarbour@WebServer:~$ snort -v
snort: error while loading shared libraries: libdnet.1: cannot open shared object file: No such file or directory
OtagoHarbour@WebServer:~$

Thanks,
OH

colucix 10-15-2013 03:02 PM

I meant that LDFLAGS should be defined before compiling. Otherwise try
Code:

export LD_LIBRARY_PATH=/usr/local/lib
or if it was already set
Code:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

OtagoHarbour 10-15-2013 03:05 PM

Quote:

Originally Posted by colucix (Post 5046347)
I meant that LDFLAGS should be defined before compiling. Otherwise try
Code:

export LD_LIBRARY_PATH=/usr/local/lib
or if it was already set
Code:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

The former solved the problem.

Thanks,
Peter.


All times are GMT -5. The time now is 07:42 AM.