Tuesday, February 7, 2012

fatal error: pcap.h - Error in Fedora terminal

I am using ns2 for my simulations. Whenever I changed something in the C++ codes of the package, I had to reconfigure everything again. The steps were to:
    make clean
    make clean
    make depend

But every time I execute the command "make depend", I get this nasty bit of error:
fatal error: pcap.h: No such file or directory compilation terminated.
So one of the solutions I found in the internet was to install libpcap-dev.
"...Usually, the library packages only provide the library files that programs using them need to run. They don't provide the header files that developers use to write programs using the libraries and the "dev" or "devel" packages containing the headers."

So I installed libpcap-devel following this short tutorial.

In the terminal (Fedora), enter the following commands:

$ yum search pcap-devel
libpcap-devel.i686 : Libraries and header files for the libpcap library
Note that you must be the root/administrator to install the package. To install this package in Red Hat/Fedora Linux.
$ yum install libpcap-devel.i686
You can check the details of this package pcap-devel
$ yum info libpcap-devel.i686

And that solves the problem. When I went back to my ns2 installation and executed "make depend", the command didn't encounter any errors.

No comments:

Post a Comment