LinuxQuestions.org
Visit Jeremy's Blog.
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 02-01-2010, 01:08 AM   #1
malli42108
Member
 
Registered: Jul 2009
Posts: 37

Rep: Reputation: 15
libpcap issue in linux 2.6 machine.


hi experts,

i am trying to run one application,it fails

[root@andd124 bcmsim_if]# ./make_encap.sh
/tmp/ccQauMUH.o: In function `main':
/bcm_linux_21_old/bcmsim/bcmsim_if/encap.c:498: undefined reference
to `pcap_lookupdev'
/bcm_linux_21_old/bcmsim/bcmsim_if/encap.c:512: undefined reference
to `pcap_open_live'
/bcm_linux_21_old/bcmsim/bcmsim_if/encap.c:519: undefined reference
to `pcap_fileno'
/bcm_linux_21_old/bcmsim/bcmsim_if/encap.c:559: undefined reference
to `pcap_dispatch'
/bcm_linux_21_old/bcmsim/bcmsim_if/encap.c:562: undefined reference
to `pcap_geterr'
/tmp/ccQauMUH.o: In function `sigquit':
/bcm_linux_21_old/bcmsim/bcmsim_if/encap.c:927: undefined reference
to `pcap_close'
collect2: ld returned 1 exit status
[root@andd124 bcmsim_if]#

It is redhat linux x86 machine. for this i tried to install libpcap which suits that version. Below is the list which i tries to install. but still i am getting above error.
1.libpcap-0.9.4-1.i586.rpm
2.libpcap-1.0.0.tar.gz

Please provide your response soon. It is blocking for me for the past 1 week. Thanks in advance.
 
Old 02-01-2010, 03:50 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Well, Redhat EL X.x is a propitiatory OS, and is expected
to work OK only when you have the paid Redhat account.
Then you have access to all the genuine Redhat packages.
And can install all packages with ' yum '.

You can find the real name for the OS with the commands :
cat /etc/issue
.. and ..
cat /etc/redhat-release

Assuming you have Redhat EL 5.x :
The current libpcap packages are libpcap-0.9.4-14.el5.i386.rpm
and libpcap-devel-0.9.4-14.el5.i386.rpm

If you have installed a random mix of packages found on the net,
there may appear some problems.

The free version of Redhat EL 5.4 is CentOS 5.4
http://distrowatch.com/index.php?dis...h=all&year=all

http://centos.org/
.....

Last edited by knudfl; 02-01-2010 at 03:52 AM.
 
Old 02-01-2010, 05:45 AM   #3
malli42108
Member
 
Registered: Jul 2009
Posts: 37

Original Poster
Rep: Reputation: 15
hi

[root@localhost lib]# cat /etc/issue
Red Hat Enterprise Linux Server release 5 (Tikanga)
Kernel \r on an \m

i am using redhat linux with kernel 2.6.

Please suggest the link and version of libpcap which also support x86.
 
Old 02-01-2010, 07:15 AM   #4
malli42108
Member
 
Registered: Jul 2009
Posts: 37

Original Poster
Rep: Reputation: 15
hi,
i tried to install libpcap-devel-0.9.4-14.el5.i386.rpm, it showed installed. But got below error.

[root@localhost bcmsim_if]# ./make_encap.sh
/usr/bin/ld: skipping incompatible /usr/lib/libpcap.so when searching for -lpcap
/usr/bin/ld: skipping incompatible /usr/lib/libpcap.a when searching for -lpcap
/usr/bin/ld: cannot find -lpcap
collect2: ld returned 1 exit status
[root@localhost bcmsim_if]# ldd /usr/lib/libpcap.a
ldd: warning: you do not have execution permission for `/usr/lib/libpcap.a'
not a dynamic executable
[root@localhost bcmsim_if]# ldd /usr/lib/libpcap.so
linux-gate.so.1 => (0xffffe000)
libc.so.6 => /lib/libc.so.6 (0xf7e7d000)
/lib/ld-linux.so.2 (0x56555000)
 
Old 02-01-2010, 11:24 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
You will need libpcap-0.9.4-14.el5.i386.rpm too for libpcap.so
to work.

This command can be used :
wget http://mirror.centos.org/centos/5.4/...4.el5.i386.rpm

.....

P.S. : The correct naming of the OS is : Redhat EL 5.
"redhat linux with kernel 2.6" is not a unique identifier.
Can be any EL4 or EL5.

( And about kernel-2.6.18-x ...
'uname -r' will show the exact kernel version.)
.....

Last edited by knudfl; 02-01-2010 at 11:44 AM.
 
Old 02-02-2010, 01:53 AM   #6
malli42108
Member
 
Registered: Jul 2009
Posts: 37

Original Poster
Rep: Reputation: 15
hi
i installed libpcap-0.9.4-14.el5.i386.rpm also but still issue not solved.

[root@localhost ]# rpm -ivh libpcap-0.9.4-14.el5.i386.rpm
warning: libpcap-0.9.4-14.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
package libpcap-0.9.4-14.el5 is already installed
[root@localhost ]# clear
[root@localhost ]#
[root@localhost bcmsim_if]# ./make_encap.sh
/usr/bin/ld: skipping incompatible /usr/lib/libpcap.so when searching for -lpcap
/usr/bin/ld: skipping incompatible /usr/lib/libpcap.a when searching for -lpcap
/usr/bin/ld: cannot find -lpcap
collect2: ld returned 1 exit status
[root@localhost bcmsim_if]#

[root@localhost bcmsim_if]# uname -a
Linux localhost.localdomain 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:14 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
 
Old 02-03-2010, 05:56 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
x86_64 x86_64 x86_64 GNU/Linux
Well, your OS is 64 bit, and so is gcc and the linker = ld.

Quote:
/usr/bin/ld: skipping incompatible /usr/lib/libpcap.so
So you cannot link against i386 libraries.
But will have to take care that only x86_64 development
packages are used, or pointed to at compile time.
.....
 
Old 02-04-2010, 06:20 AM   #8
malli42108
Member
 
Registered: Jul 2009
Posts: 37

Original Poster
Rep: Reputation: 15
Thumbs up

hi,
i installed libpcap successfully. thanks for your support.

I downloaded libpcap-1.0.0.tat.gz file and installed in my linux server. then i configured that file next given make, make install.

Thanks for your kind support.
 
  


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
Issue with 2 Linux OS in my machine peeths003 Linux - Software 14 11-22-2009 07:33 AM
Using C and libpcap in linux Mridulj Linux - Software 12 04-23-2009 04:46 AM
TCP Reconstruction(C ,libpcap,linux) kalps Programming 5 03-26-2009 12:16 AM
libnet libpcap on linux filomotta Linux - Networking 1 06-01-2005 02:03 PM
problem with libnet/libpcap on Linux filomotta Programming 0 05-31-2005 08:49 AM

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

All times are GMT -5. The time now is 02:55 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
Open Source Consulting | Domain Registration