[Winpcap-users] Re: link error using newest libpcap 0.9.3

Guy Harris guy at alum.mit.edu
Sat Sep 10 00:17:56 GMT 2005


On Sep 10, 2005, at 12:31 PM, David Chang wrote:

> Did I compile libpcap incorrectly?

Possibly.

Both of those routines are defined in libpcap in "nametoaddr.c".  At  
least as I read the RH 7.3 man pages on the FreeBSD Web site, the  
symbol index in an archive library is not generated automatically  
when the library is created, unless the "s" modifier is specified to  
the "ar" command, and the libpcap Makefile doesn't specify that  
modifier, perhaps because, at least at the time it was first created,  
not all versions of "ar" supported it.  (At least as I read the DEC  
OSF 4.0 man page on the FreeBSD Web site, its "ar" doesn't support it.)

In theory, the Makefile should run "ranlib" on libpcap after  
installing it, which would create the symbol index, but perhaps that  
doesn't work on RH 7.3.  Try running "ranlib" on "/home/dchang/svn/ 
swdev/dbpulse/dbpulse-base/linux-i386-rh7.3/lib/libpcap.a" and see if  
that works.

> By the way, I'm also using Winpcap 3.0 and my code compiles fine  
> (no link errors).  I'm wondering if I go to the latest version  
> (3.1) whether I will get those link errors.

Probably not, if the problem is fixed by "ranlib", as WinPcap is  
built as a shared library (.dll), and shared libraries are single  
object files with all symbols in them, not as archive libraries (I  
think .libs can be archive libraries) where an issue of the sort that  
can be fixed on some UN*Xes with "ranlib" could appear (although if  
Microsoft's tools always build a symbol index that won't be an issue).


More information about the Winpcap-users mailing list