免费注册 查看新帖 |

Chinaunix

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

libnet 编译问题:这是少什么东西啊? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-27 23:12 |只看该作者 |倒序浏览
#gcc -Wall `libnet-config --defines` my_libnet.c `libnet-config --libs` -lnet

my_libnet.c:158: warning: implicit declaration of function `libnet_open_link_interface'
my_libnet.c:160: warning: implicit declaration of function `libnet_error'
my_libnet.c:181: warning: implicit declaration of function `libnet_init_packet'
my_libnet.c:258: warning: implicit declaration of function `libnet_write_link_layer'
my_libnet.c:274: warning: implicit declaration of function `libnet_close_link_interface'
my_libnet.c:283: warning: implicit declaration of function `libnet_destroy_packet'

/tmp/ccj9SDyx.o(.text+0x22d): In function `my_callback':
: undefined reference to `libnet_open_link_interface'
/tmp/ccj9SDyx.o(.text+0x256): In function `my_callback':
: undefined reference to `libnet_error'
/tmp/ccj9SDyx.o(.text+0x28d): In function `my_callback':
: undefined reference to `libnet_init_packet'
/tmp/ccj9SDyx.o(.text+0x2a4): In function `my_callback':
: undefined reference to `libnet_error'
/tmp/ccj9SDyx.o(.text+0x447): In function `my_callback':
: undefined reference to `libnet_error'
/tmp/ccj9SDyx.o(.text+0x463): In function `my_callback':
: undefined reference to `libnet_write_link_layer'
/tmp/ccj9SDyx.o(.text+0x4b4): In function `my_callback':
: undefined reference to `libnet_close_link_interface'
/tmp/ccj9SDyx.o(.text+0x4cb): In function `my_callback':
: undefined reference to `libnet_error'
/tmp/ccj9SDyx.o(.text+0x4dd): In function `my_callback':
: undefined reference to `libnet_destroy_packet'
collect2: ld returned 1 exit status

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
2 [报告]
发表于 2006-11-28 10:05 |只看该作者
没找到你的libnet头文件和库文件。

论坛徽章:
0
3 [报告]
发表于 2006-11-28 10:46 |只看该作者
可即使编译加上-I/usr/include/libnet -L/usr/libs  效果还是一样的啊
(所指定的位置肯定有头文件和库文件)

论坛徽章:
0
4 [报告]
发表于 2006-11-28 11:09 |只看该作者
libnet不是系统自带和默认的。需要去网上下载。是用来发送数据包的库,就像libpcap是截获数据包的库一样。

论坛徽章:
0
5 [报告]
发表于 2006-11-28 11:10 |只看该作者
如果不行,就重新编译安装试试。在/etc/ld.so.conf中加入你的路径,然后/sbin/ldconfig试试。

论坛徽章:
0
6 [报告]
发表于 2006-11-28 13:01 |只看该作者
可是好象没有libnet.so这种文件,只有一个静态库libnet.a文件
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP