[Winpcap-users] Unexpected C++ name mangling of pcap entrypointswith MSVC++ 2005

Kevin Miles kevin.miles at delgaldo.co.uk
Tue Aug 21 20:32:10 GMT 2007


On 21 August 2007 20:01 Bryan Kadzban <bryan at kadzban.is-a-geek.net> wrote:

> On Tue, Aug 21, 2007 at 06:15:02PM +0100, Kevin Miles wrote:
>> I'm using winpcap 4.1 with MSVC++ 2005 and all references to pcap
>> entrypoints declared in pcap.h get (slightly) mangled by having an
>> underscore pre-pended to them, resulting in linker errors...
>
> I believe you can work around this by linking to the winpcap .lib file
> (wpcap.lib perhaps?).  That file provides matches for the underscored
> names, to make the linker happy, while re-pointing the code at the
> undecorated exports from the wpcap.dll file at runtime.
>
> Or at least, so I heard on some MS compiler blog at one point in the
> distant past...

It seems you heard correctly. Explicitly linking wpcap.lib gets me a clean
build. Many thanks. (I'm still curious to know why it mangles the names in
the first place, but...)

Kevin.



More information about the Winpcap-users mailing list