[Winpcap-users] linking error in cygwin.

AlicK alickguo at gmail.com
Thu Jun 12 07:15:12 GMT 2008


Hi all.

I linking my project with winpcap lib (libwpcap.a,lib version is 4.1,
size 52,398 bytes.) in cygwin then i get error info :

1.Error Info:
 gcc -Wall -Wno-format-zero-length -o eapol.o -c eapol.c
 eapol.c:69: warning: 'eap_add_ruijie_info' defined but not used
 eapol.c:104: warning: 'eap_add_client_info' defined but not used
 eapol.c:126: warning: 'eap_add_client_md5' defined but not used
 gcc -o rSu -lwpcap -lpthread eapol.o main.o md5.o supp.o
 eapol.o:eapol.c:(.text+0x695): undefined reference to `_pcap_sendpacket'
 eapol.o:eapol.c:(.text+0x818): undefined reference to `_pcap_next_ex'
 eapol.o:eapol.c:(.text+0xb12): undefined reference to `_pcap_open_live'
 eapol.o:eapol.c:(.text+0xbad): undefined reference to `_pcap_compile'
 eapol.o:eapol.c:(.text+0xbfc): undefined reference to `_pcap_close'
 eapol.o:eapol.c:(.text+0xc2c): undefined reference to `_pcap_setfilter'
 eapol.o:eapol.c:(.text+0xc7b): undefined reference to `_pcap_close'
 eapol.o:eapol.c:(.text+0xd06): undefined reference to `_pcap_close'
 eapol.o:eapol.c:(.text+0xd55): undefined reference to `_pcap_close'
 collect2: ld returned 1 exit status
 make: *** [target] Error 1

2.Then i nm the libwpcap.a, those function existes.
  d000047.o:
 00000000 i .idata$4
 00000000 i .idata$5
 00000000 i .idata$6
 00000000 i .idata$7
 00000000 t .text
          U __head_wpcap_dll
 00000000 I __imp__pcap_next_ex
 00000000 T _pcap_next_ex

3.so i disassemble the lib, those those function only has jmp & nop
instruction

1247 00000000 <_pcap_next_ex>:
1248    0:>--ff 25 00 00 00 00    >--jmp    *0x0
1249    6:>--90                   >--nop
1250    7:>--90                   >--nop
1251 Disassembly of section .idata$7:





More information about the Winpcap-users mailing list