I am trying to cross compile the source code of ndpiReader.c example application that comes with nDPI library for windows on ubuntu 14.04. The library and is hosted here, and the example is in this directory.
I have libpcap installed on my computer using this link.
I use the command ./configure --host=x86_64-w64-mingw32
from this tutorial to compile the source code. But I still get the error
ERROR: Missing libpcap(-dev) library required to compile the example application
ERROR: Please install it and try again
what am I missing for compiling this .c code? If someone knows a different way to compile this code please share it with me. All I want is to get a windows .exe file for the ndpiReader.c code.
If you're doing cross-development, you need to install cross-development version of the libraries. What you installed is the native development version of libpcap-dev, which would let you build libpcap programs for your Linux distribution, but not for other operating systems such as Windows.
Libpcap is a bit of a special case here, especially for Windows. For UN*Xes, libpcap runs atop the OS's native packet capture mechanism; for Windows, there's no such native mechanism, so there's a port of libpcap to Windows called WinPcap, which includes both libpcap and a driver that needs to be installed on the Windows machine.
So even if you succeed in building a version of the program for Windows, you'll need to install WinPcap on the Windows machines on which you want to run that program, if it's not already installed.
Then you'll need to install a cross-development WinPcap library, for use with MinGW, in order to build that program.
It looks as if Fedora has a mingw-wpcap package, which might allow cross-compilation of pcap programs for Windows, with MinGW, on Fedora. I don't know whether any such package exists for Ubuntu.