[Winpcap-users] "unresolved external symbol"

Gianluca Varenni gianluca.varenni at cacetech.com
Tue Mar 13 02:12:20 GMT 2007


----- Original Message ----- 
From: "Samuel Voiron" <samuelvoiron at gmail.com>
To: <winpcap-users at winpcap.org>
Sent: Friday, March 09, 2007 5:42 AM
Subject: [Winpcap-users] "unresolved external symbol"


> Hello,
>
> I'm trying to use the Winpcap library to develop a sniffer
> application. I am at the step of getting familiar with the basic
> functions of the API.
> I got successful running the few first examples given in the tutorial
> on LINUX (actually using libcap so, out of topic, sorry) but I am
> really struggling to have it work on WINDOWS.
> I red pretty much all I found about my problem and still can't find a
> way to sort it out.
>
> I'm using VisualC++2005Express and try to run this example :
> http://www.winpcap.org/docs/docs_40/html/group__wpcap__tut1.html>
> It compiles but I have this errors at the execution :
>
> main.obj : error LNK2019: unresolved external symbol _pcap_freealldevs
> referenced in the function _main
> main.obj : error LNK2019: unresolved external symbol
> _pcap_findalldevs_ex referenced in the function _main

You need to add wpcap.lib in the additional lib dependencies of your project 
(it's one of the linker properties). wpcap.lib is available in the lib 
folder of the developer's pack.

>
> I have seen that several people from the mailing list had similar
> problems and they seem to have been able to solve it by including lib,
> dll, etc.. files. I included all I could, even downloading wpcap.dll,
> which was not included in the winpcap development kit and putting it
> in the Wpcap directory, trying with a coppy in c:/windows/system32,

wpcap.dll is installed by the WinPcap installer. You always need to install 
WinPcap, the devpack doesn't include it.

> ...
>
> I read about including WPCAP and HAVE_REMOTE in the preprocessor
> definitions and did it.
>
> The error mentioned above still comes up.
>
> I thought about actually compiling the entire winpcap driver but found

You do not need to compile the driver to develop a WinPcap based 
application. You need

- WinPcap installed on your machine
- the developer's pack
- either Microsoft Visual Studio or cygwin

Hope it helps
GV


> that I should use a windows driver development kit, which is a 2.4GB
> iso to download... (sic)
> I don't think I have to do this and should be able to get my programs
> work with just the winpcap API.
>
> I may have omitted one very simple trick... in that case, I'm sorry
> about it but please, help me out.
>
> Thanks a lot,
> Samuel
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users 



More information about the Winpcap-users mailing list