免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8014 | 回复: 5
打印 上一主题 下一主题

libpcap安装问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-22 17:48 |只看该作者 |倒序浏览
安装libpcap1.0.0
结果安装完以后没有libpcap.so.1.0.0这个文件,只是在/usr/local/lib下有个libpcap.a这个文件

下面是安装过程

[root@PC4 libpcap-1.0.0]# ./configure
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking gcc version... 4
checking for inline... inline
checking for __attribute__... yes
checking for u_int8_t using gcc... yes
checking for u_int16_t using gcc... yes
checking for u_int32_t using gcc... yes
checking for u_int64_t using gcc... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking for _LARGEFILE_SOURCE value needed for large files... no
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/ioccom.h usability... no
checking sys/ioccom.h presence... no
checking for sys/ioccom.h... no
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking for net/pfvar.h... no
checking for netinet/if_ether.h... yes
checking for ANSI ioctl definitions... yes
checking for strerror... yes
checking for strlcpy... no
checking for vsnprintf... yes
checking for snprintf... yes
checking for library containing gethostbyname... none required
checking for library containing socket... none required
checking for library containing putmsg... none required
checking for ether_hostton... yes
checking whether ether_hostton is declared... no
checking netinet/ether.h usability... yes
checking netinet/ether.h presence... yes
checking for netinet/ether.h... yes
checking whether ether_hostton is declared... yes
checking if --disable-protochain option is specified... enabled
checking packet capture type... linux
checking Linux kernel version... 2
checking for linux/wireless.h... no
checking if if_packet.h has tpacket_stats defined... yes
checking if tpacket_auxdata struct has tp_vlan_tci member... no
checking for getifaddrs... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking for socklen_t... yes
checking for getaddrinfo... yes
checking whether to build optimizer debugging code... no
checking whether to build parser debugging code... no
checking whether we have /proc/net/dev... yes
checking whether we have DAG API headers... no (/usr/local/include)
checking whether we have the DAG API... no
checking whether we have Septel API... no
checking for flex... flex
checking for flex 2.4 or higher... yes
checking for bison... bison
checking for ranlib... ranlib
checking if sockaddr struct has sa_len member... no
checking if sockaddr_storage struct exists... yes
checking if dl_hp_ppa_info_t struct has dl_module_id_1 member... no
checking if unaligned accesses fail... no
rm: cannot remove `net': Is a directory
ln: creating symbolic link `net/net' to `./bpf/net': File exists
checking for USB sniffing support... yes
configure: Device for USB sniffing is /dev/usbmon
checking bluetooth/bluetooth.h usability... no
checking bluetooth/bluetooth.h presence... no
checking for bluetooth/bluetooth.h... no
configure: Bluetooth sniffing is not supported; install bluez-lib devel to enable it
checking for a BSD-compatible install... /usr/bin/install -c
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pcap-filter.manmisc
config.status: creating pcap-linktype.manmisc
config.status: creating pcap-savefile.manfile
config.status: creating pcap.3pcap
config.status: creating pcap_compile.3pcap
config.status: creating pcap_datalink.3pcap
config.status: creating pcap_dump_open.3pcap
config.status: creating pcap_list_datalinks.3pcap
config.status: creating pcap_open_dead.3pcap
config.status: creating pcap_open_offline.3pcap
config.status: creating config.h
[root@PC4 libpcap-1.0.0]# make
sed -e 's|@includedir[@]|/usr/local/include|g' \
            -e 's|@libdir[@]|/usr/local/lib|g' \
            -e 's|@DEPLIBS[@]||g' \
            pcap-config.in >pcap-config.tmp
mv pcap-config.tmp pcap-config
chmod a+x pcap-config
[root@PC4 libpcap-1.0.0]# 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
[root@PC4 libpcap-1.0.0]#
[root@PC4 libpcap-1.0.0]# find  / -name    "libpcap.so.*.*.*"
[root@PC4 libpcap-1.0.0]#

论坛徽章:
0
2 [报告]
发表于 2009-10-22 22:11 |只看该作者
yum install libpcap

论坛徽章:
0
3 [报告]
发表于 2009-10-24 12:21 |只看该作者
这个.a就是静态库了,应该可以使用了

论坛徽章:
0
4 [报告]
发表于 2009-10-24 12:22 |只看该作者
编译其他程序的时候连接这个库就ok了

论坛徽章:
0
5 [报告]
发表于 2009-10-28 22:42 |只看该作者

回复 #1 testvpn 的帖子

静态编译gcc的环境问题

论坛徽章:
0
6 [报告]
发表于 2009-10-31 22:02 |只看该作者
make libpcap.so即可
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP