LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-15-2013, 01:48 PM   #1
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 309

Rep: Reputation: 3
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.
 
Old 10-15-2013, 02:44 PM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
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.
 
Old 10-15-2013, 02:54 PM   #3
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 309

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by colucix View Post
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
 
Old 10-15-2013, 03:02 PM   #4
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
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
 
Old 10-15-2013, 03:05 PM   #5
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 309

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by colucix View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
libXft.so.2: cannot open shared object file: No such file or directory mainstream Linux - Newbie 2 06-26-2012 12:23 PM
[SOLVED] ??? Error: libXp.so.6: cannot open shared object file: No such file or directory castles Linux - Newbie 7 01-18-2012 12:49 PM
[SOLVED] cannot open shared object file: No such file or directory - but the file is there! Ook Slackware 5 08-24-2011 05:13 PM
cannot open shared object file: No such file or directory (0) SQLSTATE=00000?? suliman_shah Programming 3 08-23-2007 01:02 PM
libawt.so: libXp.so.6: cannot open shared object file: No such file or directory man26 *BSD 0 09-10-2004 08:34 AM


All times are GMT -5. The time now is 03:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration