开发者

error: ‘LIBNET_ERR_FATAL’ with libnet

开发者 https://www.devze.com 2023-01-17 06:32 出处:网络
I write a demo with libnet, but get an error when call the function: libnet_error(LIBNET_ERR_FATAL, \"libnet_open_link_interface: %s\\n\", errbuf);

I write a demo with libnet, but get an error when call the function:

libnet_error(LIBNET_ERR_FATAL, "libnet_open_link_interface: %s\n", errbuf);

The error is "e开发者_Go百科rror: ‘LIBNET_ERR_FATAL’ undeclared (first use in this function)".

my gcc command is: "gcc demo.c libnet-config --defines --cflags --libs", and run on ubuntu.

I want to know who got the same error before ?


It's the version problem, LIBNET_ERR_FATAL have been removed in 1.1!


To complete the answer, the LIBNET_ERR_FATAL and the function libnet_error() and some other good old things are included in libnet-1.0.2a. You can still download a compilable source here: https://code.google.com/p/ips-builder/downloads/detail?name=libnet-1.0.2a.tar.gz&can=2&q=

As I tried, it can be compiled on Ubuntu 12.04 with gcc 4.6.3. Do remember to add sudo before running the make install. Otherwise, it will fail to create the user/include/libnet due to permission issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消