What's wrong with linux/if.h and net/if.h?
For me (on Ubuntu 12.04 x64) the following include solved the problem:
#include <sys/socket.h> // <-- This one
#include <linux/if.h>
#include <linux/if_tun.h>
This problem has been resolved, add the compile flag -DHAVE_PCAP is fix. ;-)