LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 11-04-2010, 11:31 AM   #1
pawelch
LQ Newbie
 
Registered: Jul 2010
Posts: 26

Rep: Reputation: 0
Unhappy ntop on Ubuntu: with the error undefined reference to `pcap_parse'


Dear all,

while installing the ntop I am experiencing the following problem:

Code:
/usr/local/lib/libpcap.so: undefined reference to `pcap_parse'
collect2: ld returned 1 exit status
I am able to compile programs that use pcap without any errors.

Please, give me suggestions from where I should start debugging
 
Old 11-04-2010, 01:21 PM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You didn't say what version of ntop you're installing, but I guess you need a more recent version of libpcap.
FYI ntop-4.0.1 works fine here with libpcap-1.1.1.

Regards
 
Old 11-05-2010, 07:52 AM   #3
pawelch
LQ Newbie
 
Registered: Jul 2010
Posts: 26

Original Poster
Rep: Reputation: 0
newest of both, those are:
ntop-4.0.1
libpcap-1.1.1

I tried to download ntop as a package and with svm:

Code:
svn co https://svn.ntop.org/svn/ntop/trunk/ntop
I have installed the libpcap as well as I have a software that actually works on it ( as I mentioned above) the problem is that the only reasonable solution I have come across on the Internet is that (the guy is saying that he reinstalled Debian eventually):
http://www.gossamer-threads.com/lists/ntop/misc/23774
Apart from that, there is a massive list of unresolved problems of this kind, which has got no solution except "it works fine for me".

Thank for your help.
 
Old 11-05-2010, 07:57 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
What give the 2 commands bellow:
Code:
ldd /usr/local/bin/ntop |grep pcap
nm /usr/local/lib/libpcap.so|grep pcap_parse
 
Old 11-05-2010, 08:11 AM   #5
pawelch
LQ Newbie
 
Registered: Jul 2010
Posts: 26

Original Poster
Rep: Reputation: 0
Code:
ldd /usr/local/bin/ntop |grep pcap
ldd: /usr/local/bin/ntop: No such file or directory
and the second one:

Code:
nm /usr/local/lib/libpcap.so|grep pcap_parse
0001ee80 T pcap_parse
maybe I should have added that I had gone through the "./configure"/ "/autogen.sh" part - and ended up with no errors whatsoever, however, while I try to do "make" I get the error from above.

Best!

Last edited by pawelch; 11-05-2010 at 08:18 AM.
 
Old 11-05-2010, 09:15 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Just downloaded and installed ntop from svn to test if it's a problem of the svn version. Well it also worked without a hitch. Btw you have to run only ./autogen.sh before make, unless you want to tweak things through ./configure.
Anyway I guess that the autogen/configure script picks a wrong pcap library. Maybe an older one that comes with your system. You may uninstall it if that's the case, or you can try the following with ./configure, after running "make distclean":
Code:
LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure
so it picks libpcap-1.1.1
 
Old 11-05-2010, 12:16 PM   #7
pawelch
LQ Newbie
 
Registered: Jul 2010
Posts: 26

Original Poster
Rep: Reputation: 0
Hi bathory,
I have done what you suggested:

Code:
LDFLAGS=-L/usr/local/lib CPPFLAGS=-I/usr/local/include ./configure
and got the same error.
so I went on to remove everything from the system that might have had a "libpcap" in the name. I installed libpcap first and got the same error (pcap_parse missing) while compiling the program I mentioned. so at that time I had libpcap installed but compiler (gcc) could not get the pcap_parse thing. I installed lipcap-dev and the error disappeared from compilation - but still exist while I try to do make for ntop.

any other suggestions?

best regards and thank you for your time.
 
Old 11-05-2010, 01:44 PM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
I guess you ran "make distclean" before running the configure script again.
Also since you've installed libpcap from source, you don't need any libpcap-dev packages. Everything needed by other programs to compile against libpcap is installed if you compile the library from source.
Besides the supposed undefined symbol (pcap_parse) is well defined according to the nm output.

Other suggestions? Run:
Code:
updatedb
locate libpcap.so
locate pcap.h
ls -l /path/to/any/libpcap.so
If they are not the files installed from sources (re)move them and try to compile ntop again.
You can also add as a first item in /etc/ld.so.conf the path /usr/local/lib (and run ldconfig afterwards).
Also before running ./configure try to set LD_LIBRARY_PATH. For the bash shell, use:
Code:
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
 
  


Reply



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
Undefined reference error jacques83 Programming 20 04-11-2013 07:23 AM
Undefined Reference error JMJ_coder Programming 6 03-20-2008 01:27 AM
undefined reference error ilnli Programming 2 08-02-2007 08:34 PM
undefined reference error bahadur Programming 5 07-25-2006 09:18 PM
undefined reference error Quest101 Programming 3 01-01-2005 12:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:41 PM.

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
Open Source Consulting | Domain Registration