LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-10-2009, 08:04 AM   #1
charlotte01
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Rep: Reputation: 0
libpcap-1.0.0 installation problem


"]
Hello,everyone, can you help me ?
I have some problems in the installation of libpcap-1.0.0,

os@os-desktop:~/final/libpcap-1.0.0$ sudo make install
[ -d /usr/local/lib ] || \
(mkdir -p /usr/local/lib; chmod 755 /usr/local/lib)
/usr/bin/install -c -m 644 libpcap.a /usr/local/lib/libpcap.a
ranlib /usr/local/lib/libpcap.a
[ -d /usr/local/include ] || \
(mkdir -p /usr/local/include; chmod 755 /usr/local/include)
[ -d /usr/local/include/pcap ] || \
(mkdir -p /usr/local/include/pcap; chmod 755 /usr/local/include/pcap)
[ -d /usr/local/share/man/man1 ] || \
(mkdir -p /usr/local/share/man/man1; chmod 755 /usr/local/share/man/man1)
[ -d /usr/local/share/man/man3 ] || \
(mkdir -p /usr/local/share/man/man3; chmod 755 /usr/local/share/man/man3)
[ -d /usr/local/share/man/man5 ] || \
(mkdir -p /usr/local/share/man/man5; chmod 755 /usr/local/share/man/man5)
[ -d /usr/local/share/man/man7 ] || \
(mkdir -p /usr/local/share/man/man7; chmod 755 /usr/local/share/man/man7)
/usr/bin/install -c -m 644 ./pcap/pcap.h \
/usr/local/include/pcap/pcap.h
/usr/bin/install -c -m 644 ./pcap/bpf.h \
/usr/local/include/pcap/bpf.h
/usr/bin/install -c -m 644 ./pcap/namedb.h \
/usr/local/include/pcap/namedb.h
/usr/bin/install -c -m 644 ./pcap/sll.h \
/usr/local/include/pcap/sll.h
/usr/bin/install -c -m 644 ./pcap/usb.h \
/usr/local/include/pcap/usb.h
/usr/bin/install -c -m 644 ./pcap.h /usr/local/include/pcap.h
/usr/bin/install -c -m 644 ./pcap-bpf.h \
/usr/local/include/pcap-bpf.h
/usr/bin/install -c -m 644 ./pcap-namedb.h \
/usr/local/include/pcap-namedb.h
/usr/bin/install -c pcap-config /usr/local/bin/pcap-config
for i in pcap-config.1; do \
/usr/bin/install -c -m 644 ./$i \
/usr/local/share/man/man1/$i; done
for i in pcap_activate.3pcap pcap_breakloop.3pcap pcap_can_set_rfmon.3pcap pcap_close.3pcap pcap_create.3pcap pcap_datalink_name_to_val.3pcap pcap_datalink_val_to_name.3pcap pcap_dump.3pcap pcap_dump_close.3pcap pcap_dump_file.3pcap pcap_dump_flush.3pcap pcap_dump_ftell.3pcap pcap_file.3pcap pcap_fileno.3pcap pcap_findalldevs.3pcap pcap_freealldevs.3pcap pcap_freecode.3pcap pcap_free_datalinks.3pcap pcap_get_selectable_fd.3pcap pcap_geterr.3pcap pcap_inject.3pcap pcap_is_swapped.3pcap pcap_lib_version.3pcap pcap_lookupdev.3pcap pcap_lookupnet.3pcap pcap_loop.3pcap pcap_major_version.3pcap pcap_next_ex.3pcap pcap_offline_filter.3pcap pcap_open_live.3pcap pcap_set_buffer_size.3pcap pcap_set_datalink.3pcap pcap_set_promisc.3pcap pcap_set_rfmon.3pcap pcap_set_snaplen.3pcap pcap_set_timeout.3pcap pcap_setdirection.3pcap pcap_setfilter.3pcap pcap_setnonblock.3pcap pcap_snapshot.3pcap pcap_stats.3pcap pcap_statustostr.3pcap pcap_strerror.3pcap pcap.3pcap pcap_compile.3pcap pcap_datalink.3pcap pcap_dump_open.3pcap pcap_list_datalinks.3pcap pcap_open_dead.3pcap pcap_open_offline.3pcap; do \
/usr/bin/install -c -m 644 ./$i \
/usr/local/share/man/man3/$i; done
ln /usr/local/share/man/man3/pcap_datalink_val_to_name.3pcap \
/usr/local/share/man/man3/pcap_datalink_val_to_description.3pcap
ln /usr/local/share/man/man3/pcap_dump_open.3pcap \
/usr/local/share/man/man3/pcap_dump_fopen.3pcap
ln /usr/local/share/man/man3/pcap_geterr.3pcap \
/usr/local/share/man/man3/pcap_perror.3pcap
ln /usr/local/share/man/man3/pcap_inject.3pcap \
/usr/local/share/man/man3/pcap_sendpacket.3pcap
ln /usr/local/share/man/man3/pcap_loop.3pcap \
/usr/local/share/man/man3/pcap_dispatch.3pcap
ln /usr/local/share/man/man3/pcap_major_version.3pcap \
/usr/local/share/man/man3/pcap_minor_version.3pcap
ln /usr/local/share/man/man3/pcap_next_ex.3pcap \
/usr/local/share/man/man3/pcap_next.3pcap
ln /usr/local/share/man/man3/pcap_open_offline.3pcap \
/usr/local/share/man/man3/pcap_fopen_offline.3pcap
ln /usr/local/share/man/man3/pcap_setnonblock.3pcap \
/usr/local/share/man/man3/pcap_getnonblock.3pcap
for i in pcap-savefile.manfile.in; do \
/usr/bin/install -c -m 644 ./`echo $i | sed 's/.manfile.in/.manfile/'` \
/usr/local/share/man/man5/`echo $i | sed 's/.manfile.in/.5/'`; done
for i in pcap-filter.manmisc.in pcap-linktype.manmisc.in; do \
/usr/bin/install -c -m 644 ./`echo $i | sed 's/.manmisc.in/.manmisc/'` \
/usr/local/share/man/man7/`echo $i | sed 's/.manmisc.in/.7/'`; done

I thought libpcap is installed successfully,but when I tried to test it I got this:
os@os-desktop:~$ gcc -o device device.c -lpcap
/usr/bin/ld: skipping incompatible /usr/local/lib/libpcap.a when searching for -lpcap
/usr/bin/ld: cannot find -lpcap
collect2: ld returned 1 exit status
[/SIZE][/B][/B]

Last edited by charlotte01; 03-11-2009 at 06:56 AM.
 
Old 03-10-2009, 10:04 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

It seems, that you only made the static lib, libpcap.a .

So when 'ld' is looking for libpcap.so or what ever the
'so' name is, nothing is found.

Try with libpcap again : ./configure --help .
Look for an option like : --enable-shared
and use it to create the shared libs = libpcap.so, etc.
.....
And please edit your post to "normal" letters, oversized
text is not very readable.
And please use code tags ...
http://www.linuxquestions.org/questi....php?do=bbcode
.....

Last edited by knudfl; 03-10-2009 at 10:08 AM.
 
Old 03-11-2009, 06:58 AM   #3
charlotte01
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Another problem

The problem with libpcap installation might be solved because the test was OK,but when I tried to install hafiye-1.0 , it's came to:

os@os-desktop:~/final/hafiye-1.0$ make
cc -o hafiye -g Data.o Infra.o Cfg.o Sniff.o Packet.o main.o /usr/lib/libpcap.a
/usr/bin/ld: /usr/lib/libpcap.a(pcap-linux.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: /usr/lib/libpcap.a(pcap-linux.o): Relocations in generic ELF (EM: 40)
/usr/lib/libpcap.a: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [all] Error 1
 
Old 03-11-2009, 03:30 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Not knowing your system ( Fedora -version, Ubuntu -version
Suse -version......... etc.) makes it difficult to give the right
advise, but how about installing the 'libpcap' +
'libpcap-dev(el)' with your package manager ? ?
.....
So which "Linux" are you using ?
.....

Last edited by knudfl; 03-11-2009 at 04:09 PM.
 
Old 03-14-2009, 04:33 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
The very old 'hafiye-1.0' ( it's from year 2002 )
will compile with no problems using libpcap-0.9.8 or similar.
( You may have used the latest = 1.0.0 ).

But it will fail by linking on 'any newer Linux' because of :
Code:
/usr/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in Data.o
So you will have to look for another "TCP/IP packet sniffer".
.....

Last edited by knudfl; 03-14-2009 at 04:37 AM.
 
Old 03-15-2009, 04:34 AM   #6
charlotte01
LQ Newbie
 
Registered: Mar 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you for explaining the problem.I tried to install tcpdump-4.0.0 but came to the same problem:

os@os-desktop:~/final/tcpdump-4.0.0$ make
...
...
./../libpcap-1.0.0/libpcap.a(savefile.o): In function `pcap_dump_ftell':
savefile.c.text+0xe0): multiple definition of `pcap_dump_ftell'
pcap_dump_ftell.ocap_dump_ftell.c.text+0x0): first defined here
/usr/bin/ld: ./../libpcap-1.0.0/libpcap.a(pcap-linux.o): Relocations in generic ELF (EM: 40)
/usr/bin/ld: ./../libpcap-1.0.0/libpcap.a(pcap-linux.o): Relocations in generic ELF (EM: 40)
./../libpcap-1.0.0/libpcap.a: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** [tcpdump] Error 1

So I think it's not the "version problem".
P.S: OS is Ubuntu 7.10.
 
Old 03-15-2009, 05:06 AM   #7
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,513

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Suggest : Remove ( or hide away ) all libpcap-1.0.0 .

And install the system version, with
'sudo apt-get install libpcap-dev'
( if Ubuntu Dapper 7.10 is still supported )
or get the packages here
http://packages.ubuntu.com/dapper/libpcap-dev
http://packages.ubuntu.com/dapper/libpcap0.7
.....

As mentioned in post # 5, an older version will
probably work. Do not use any newer than 0.9.8 !
The system version = 0.7.2 should be fine.
.....

Last edited by knudfl; 03-15-2009 at 05:13 AM.
 
  


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
problem with libpcap ARCIS_house Linux - Newbie 9 06-05-2006 12:41 AM
Installation problem libpcap-0.9.4. Please help qasali Programming 1 05-29-2006 12:33 PM
Installation problem libpcap-0.9.4. Please help qasali Linux - Software 1 05-28-2006 07:37 AM
libpcap 0.8.3 installation problem open2rock Linux - Software 3 05-15-2004 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:23 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