I have a programming assignment where I need to use the pcap lib.
#define _BSD_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pcap.h> // <-- missing include
#include <netinet/ip.h>
#include <netinet/tcp.h>
void logpacket( unsigned char* payload, struct ip* ipheader, struct tcphdr* tcpheader )
{
//...
}
int main(int argc, char* argv[] )
{
//...
}
How can I get the library files I need to compile this program?
For Ubuntu 12.04, 12.10, 13.10, 14.04 and onward open the terminal and type:
You can install them. Try with command
I guess that you need dev lib. On my pc list is:
Try adding one by one with dependency
On "Trusty Tahr" following is worked for me: