Question

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 "error: ‘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 ?

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top