If you're developing a program that uses a particular library, you will need to have the header files that declare functions and variables, and define data types and constants, required by programs using that library.
If you're doing this on Linux:
Linux distributions usually have more than one installable package for a library:
- The package whose name is the name of the library, such as "libpcap", includes shared libraries, which are required in order to run programs built with the shared version of the library, but does not include the header files.
- The package whose name is the name of the library plus a suffix such as "-devel" or "-dev", includes the library's headers.
The idea is that:
- the first package is installed if any programs linked with the shared version of the library is installed - typically, the packages for those programs include the first package for the library as a dependency, so that if the program's package is installed, the first package for the library is also installed;
- the second package is only installed if the user wants to develop a program using the library.
Thus, as you're developing a program using libpcap, you'd have to, as others have noted, install the libpcap-devel or libpcap-dev or... package (the name would depend on the distribution you're using).
Note that this isn't something special about libpcap; it applies to other libraries. For example, just as, on Debian and derivatives such as Ubuntu, there's a libpcap-0.8 package (the "0.8" is there for historical reasons) and a libpcap-0.8-dev package (and a libpcap-dev package, which I think is a better-named alias for libpcap-0.8-dev) there's a libssl package and a libssl-dev package.
Operating systems other than Linux may do this differently. For example, macOS doesn't provide headers, but the software development kits in Xcode do, and you get headers for all the macOS APIs, including libpcap - no need to install individual packages, just install Xcode. I think the BSDs either always provide the headers or provide them if you install the compilers.