LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 08-19-2012, 10:05 PM   #1
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 263

Rep: Reputation: 3
ERROR! Libpcap library/headers (libpcap.a (or .so)/pcap.h) not found


I am running Ubuntu 11.10. I downloaded libpcap-1.3.0.tar.gz to /temp, unzipped and untarred it, went into /tmp/libpcap-1.3.0 and did the following

Code:
./configure
make
make install
Everything went w/o errors but when I subseqnetly download barnyard2-1.9.tar.gz to /tmp, unzip and untar it, go into /tmp/barnyard2-1.9 and run

Code:
./configure
I get

Code:
ERROR!  Libpcap library/headers (libpcap.a (or .so)/pcap.h)
   not found, go get it from http://www.tcpdump.org
   or use the --with-libpcap-* options, if you have it installed
   in unusual place.  Also check if your libpcap depends on another
   shared library that may be installed in an unusual place
When I do a search for libpcap.a, I find

Code:
/tmp/libpcap-1.3.0/libpcap.a
/usr/local/lib/libpcap.a
It would appear that I have not installed it in a way that it can be found by the system. It could be that I installed it as myself and not as root.

Any assistance with fixing this problem would be greatly appreciated.

Peter.
 
Old 08-19-2012, 11:49 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,739

Rep: Reputation: 298Reputation: 298Reputation: 298
Quote:
It would appear that I have not installed it in a way that it can be found by the system. It could be that I installed it as myself and not as root.
You could not have written anything outside of your /home directory as user; only as root.

With regard to the failure of barnyard to ./configure, it may be that it is looking for a higher version of libpcap that the one you have installed, or it may be looking for libpcap in another location.

Things to try:
1) inspect the source code to see the location it expects to find libpcap, the either symlink or hard link your libpcap to that location.
2) rerun ./configure with the appropriate option to search for libpcap in it present location to see if that works.
 
1 members found this post helpful.
Old 08-20-2012, 12:11 AM   #3
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 657

Rep: Reputation: 66
make sure that headers can be found:
Code:
`gcc -print-prog-name=cc1` -v -o /dev/null </dev/null
and, unless you are going to compile against libpcap.a, that libpcap is in cache:
Code:
$ /sbin/ldconfig -p | grep libpcap
 
Old 08-20-2012, 08:41 PM   #4
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 263

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by bigrigdriver View Post
You could not have written anything outside of your /home directory as user; only as root.

With regard to the failure of barnyard to ./configure, it may be that it is looking for a higher version of libpcap that the one you have installed, or it may be looking for libpcap in another location.

Things to try:
1) inspect the source code to see the location it expects to find libpcap, the either symlink or hard link your libpcap to that location.
2) rerun ./configure with the appropriate option to search for libpcap in it present location to see if that works.
Thank you for your reply

All of the missing files it mentions are in /tmp/libpcap-1.3.0. I ran the following

Code:
./configure --with-libpcap-libraries=/tmp/libpcap-1.3.0 --with-libpcap-includes=/tmp/libpcap-1.3.0
and still got

Code:
ERROR!  Libpcap library/headers (libpcap.a (or .so)/pcap.h)
   not found, go get it from http://www.tcpdump.org
   or use the --with-libpcap-* options, if you have it installed
   in unusual place.  Also check if your libpcap depends on another
   shared library that may be installed in an unusual place
Thanks,
Peter.
 
Old 08-20-2012, 08:44 PM   #5
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 263

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Ygrex View Post
make sure that headers can be found:
Code:
`gcc -print-prog-name=cc1` -v -o /dev/null </dev/null
Returned
Code:
ignoring nonexistent directory "/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../i686-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/i686-linux-gnu/4.6.1/include
 /usr/local/include
 /usr/lib/gcc/i686-linux-gnu/4.6.1/include-fixed
 /usr/include
End of search list.

Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <early_local_cleanups> <whole-program> <inline>Assembling functions:

Execution times (seconds)
 TOTAL                 :   0.00             0.00             0.00                626 kB
Quote:
and, unless you are going to compile against libpcap.a, that libpcap is in cache:
Code:
$ /sbin/ldconfig -p | grep libpcap

Returned
Code:
libpcap.so.0.8 (libc6) => /usr/lib/i386-linux-gnu/libpcap.so.0.8
Thanks,
Peter.
 
Old 08-24-2012, 06:20 PM   #6
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 657

Rep: Reputation: 66
well, did you check if pcap.h can be found in one of the listed directories for includes?
 
Old 08-26-2012, 04:22 PM   #7
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 263

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Ygrex View Post
well, did you check if pcap.h can be found in one of the listed directories for includes?
Yes indeed!

Code:
peter@peter-Inspiron-620:~$ sudo find / -name pcap.h -print
/tmp/libpcap-1.3.0/pcap/pcap.h
/tmp/libpcap-1.3.0/pcap.h
/usr/local/include/pcap/pcap.h
/usr/local/include/pcap.h
peter@peter-Inspiron-620:~$
Thanks,
Peter.
 
Old 08-26-2012, 05:41 PM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
Surely libpcap is in the repos?
 
Old 08-27-2012, 01:05 AM   #9
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 657

Rep: Reputation: 66
there's should be config.log file with exact test code that failed
 
Old 08-27-2012, 02:56 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,519

Rep: Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495Reputation: 2495
The development files for libpcap, Ubuntu 11.10 :

sudo apt-get install libpcap-dev

http://packages.ubuntu.com/oneiric/libpcap-dev
http://packages.ubuntu.com/oneiric/libpcap0.8-dev


.

Last edited by knudfl; 08-27-2012 at 02:57 AM.
 
1 members found this post helpful.
Old 08-28-2012, 01:54 PM   #11
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 263

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by knudfl View Post
The development files for libpcap, Ubuntu 11.10 :

sudo apt-get install libpcap-dev

http://packages.ubuntu.com/oneiric/libpcap-dev
http://packages.ubuntu.com/oneiric/libpcap0.8-dev


.
That worked!!! Thanks very much! I did the same for snort as well.
 
Old 08-28-2012, 01:58 PM   #12
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 263

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by Ygrex View Post
there's should be config.log file with exact test code that failed
There is config.log in /tmp/barnyard2-1.9 . It ends with a bunch of #defines now that ./configure has worked properly.

Thanks,
Peter.
 
Old 08-28-2012, 01:59 PM   #13
OtagoHarbour
Member
 
Registered: Oct 2011
Posts: 263

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by chrism01 View Post
Surely libpcap is in the repos?
Not sure I understand the question but it was only in the directories I mentioned.

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
"cannot stat `libpcap.so.1.0.0':" error during make of Libpcap 1.0.0 on Fedora 9 myriad_moments Linux - Software 4 04-09-2010 02:02 AM
problem linking against libpcap library. brokencog Linux - Software 9 08-10-2008 10:32 PM
Can't access libpcap library :( inthefuture Programming 8 06-24-2004 05:30 PM
Can't Access Libpcap Library with Knoppix inthefuture Linux - Software 2 06-23-2004 07:39 AM
libpcap.so.0 is needed by perl-Net-Pcap-0.04-5 r4736 Linux - Software 8 10-18-2003 03:04 PM


All times are GMT -5. The time now is 10:20 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration