Installing winpcap and configure it with cygwin

When I put the ./configure command in my Cygwin terminal to compile a source code program , I got this error :

ERROR! Libpcap library/headers not found.
TCPDUMP/LIBPCAP public repository is a good place to fetch one
if libpcap library is installed, use the --with-libpcap-* options
to specify pathes to include and library files locations.

So , because I have windows xp as an operating system , I downloaded winpcap from this link :

WinPcap � Developer Resources

I extracted it to Cygwin directory which is C:\cygwin , then followed this link to configure winpcap with cygwin :

help installing libpcap on cygwin - Stack Overflow

In the second link , someone talked about installing some libraries :

"

  1. Be sure you have installed Winpcap libraries and that they are in your path by typing:
    which packet.dll which wpcap.dll

because I do not have both dll , I downloaded both of them from this link :

wpcap.dll download missing file - DllDump

then put them in C:\WINDOWS\system32 .Moreover , I did exactly what second link said :

  1. Copy libraries like this:
    [list]
  2. WpdPack\Lib\libpacket.a to cygwin\lib\
  3. WpdPack\Lib\libwpcap.a to cygwin\lib\
    [/list]
  4. Create a folder cygwin\usr\include\pcap\
  5. Copy all headers from WpdPack\Include to cygwin\usr\include\winpcap\
  6. Be sure you have installed Winpcap libraries and that they are in your path by typing:
    which packet.dll which wpcap.dll

But when I followed the rest which is :

Building example using Cygwin
Open a cygwin prompt to WpdPack\Examples-pcap\basic_dump\ and execute:
basic_dump:

and tried to execute the basic_dump, basic_dump_ex and iflist commands , I got basic_dump : command not found
basic_dump_ex : command not found
iflist : command not found

So I added path C:\cygwin\WpdPack\Examples-pcap\basic_dump in windows environment variable

but to my surprise I still got command not found when I run the command above
What should I do ? or what I am missing ?

Try this:-
Open up CygWin.
From the prompt type:-

echo $PATH

You will notice the PATH contains nothing like your...

C:\cygwin\WpdPack\Examples-pcap\basic_dump

...inside it, instead will look someting like:-

......:/cygdrive/c/cygwin/WpdPack/Examples-pcap/basic_dump......

If you don't have something like this somewhere in CygWin's PATH then you might need to reboot XP to ensure the correct Windows PATH is initialised...

Also try from the correct directory:-

./basic_dump

I put the WpdPack folder outside Cygwin in C:\ then I added its path to windows

like this : C:\WpdPack\Examples-pcap\basic_dump environment after that I

reboot my computer and run the command :

echo $PATH and this is what I got so far :

/cygdrive/c/WpdPack/Examples-pcap/basic_dump

then I tried to run :

./basic_dump

However it did not work :

-bash: ./basic_dump: No such file or directory

and with this command

basic_dump

-bash: basic_dump: command not found

I am stuck :frowning:

Hi steve120...

Right so the directory/folder/drawer exists.
From the fact the you have already tried './basic_dump' then it probably is not there; however, assuming you are using CygWin......

Have you listed the directory to see if the executable exists?
(Note - IF it exists, assuming it is NOT a batch file, it WILL have the extension <file>.exe .)

cd /cygdrive/c/WpdPack/Examples-pcap/basic_dump

ls -l basic_dump.*

If it does show up then check 'rwx' access rights.
(Also check directory, (per level), access rights too.)

If it doesn't then use 'find' to search for it.

cd /cygdrive/c/WpdPack/

find . -name "basic_dump.*"

Hope this helps...

Hello wisecracker and thank you for your reply

I listed all the files in this directory /cygdrive/c/WpdPack/Examples-pcap/basic_dump and this is what I got :

basic_dump.c basic_dump.dsp basic_dump.dsw basic_dump.vcproj GNUmakefile

As you can see there is NO basic_dump with .exe extension

the command : ls -l basic_dump.* gives me this :

-rwxr-x---+ 1 Administrator None 2737 Dec 23 2008 basic_dump.c
-rwxr-x---+ 1 Administrator None 4558 May 20 2005 basic_dump.dsp
-rwxr-x---+ 1 Administrator None 543 May 20 2005 basic_dump.dsw
-rwxr-x---+ 1 Administrator None 7671 Jul 24 2009 basic_dump.vcproj

these commands :
cd /cygdrive/c/WpdPack/
find . -name "basic_dump.*" give me this result:

./Examples-pcap/basic_dump/basic_dump.c
./Examples-pcap/basic_dump/basic_dump.dsp
./Examples-pcap/basic_dump/basic_dump.dsw
./Examples-pcap/basic_dump/basic_dump.vcproj
./Examples-remote/misc/basic_dump.c
./Examples-remote/misc/basic_dump.dsp
./Examples-remote/misc/basic_dump.vcproj

Moreover , I looked for an .exe file in all the folder of WpdPack but I could not find any file with .exe extension nothing special , the problem still persists :frowning:

Hi steve120...

This is a Visual Studio, (Visual C by the looks of things), project and well beyond my knowledge. I have never used Visual Studio so I can't help...

I might be better to ask in Windows forums or try to obtain the full source code for the UNIX like format so that the gcc suite can be used to compile the source...

I will have to back off now and let you research any Windows Visual Studio forums...

Thank you anyway :slight_smile: