<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>I use Dev-C++ try to compile the example pcap_filter as a C projec and got failed:<BR>
<BR>
make.exe -f "D:\FJK\pcap_filter\Makefile.win" all<BR>gcc.exe -c pcap_filter.c -o pcap_filter.o -I"D:/FJK/Dev-Cpp/include" -I"D:/FJK/Dev-Cpp/include/winpcap" <BR>
In file included from D:/FJK/Dev-Cpp/include/winpcap/pcap-stdinc.h:52,<BR> from D:/FJK/Dev-Cpp/include/winpcap/pcap.h:41,<BR> from pcap_filter.c:38:<BR>D:/FJK/Dev-Cpp/include/winpcap/bittypes.h:36: error: redefinition of typedef 'int8_t'<BR>D:/FJK/Dev-Cpp/include/stdint.h:27: error: previous declaration of 'int8_t' was here<BR>D:/FJK/Dev-Cpp/include/winpcap/bittypes.h:52: error: redefinition of typedef 'int16_t'<BR>D:/FJK/Dev-Cpp/include/stdint.h:29: error: previous declaration of 'int16_t' was here<BR>D:/FJK/Dev-Cpp/include/winpcap/bittypes.h:71: error: redefinition of typedef 'int32_t'<BR>D:/FJK/Dev-Cpp/include/stdint.h:31: error: previous declaration of 'int32_t' was here<BR>
make.exe: *** [pcap_filter.o] Error 1<BR>
<BR>
If I compiled it as a C++ project, the error info is:<BR>
<BR>
make.exe -f "D:\FJK\pcap_filter\Makefile.win" all<BR>g++.exe -c pcap_filter.c -o pcap_filter.o -I"D:/FJK/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"D:/FJK/Dev-Cpp/include/c++/3.4.2/backward" -I"D:/FJK/Dev-Cpp/include/c++/3.4.2/mingw32" -I"D:/FJK/Dev-Cpp/include/c++/3.4.2" -I"D:/FJK/Dev-Cpp/include" -I"D:/FJK/Dev-Cpp/include/winpcap" <BR>
g++.exe pcap_filter.o -o "Pcap_filter.exe" -L"D:/FJK/Dev-Cpp/lib" -L"D:/FJK/Dev-Cpp/lib/winpcap" <BR>
pcap_filter.o(.text+0x155):pcap_filter.c: undefined reference to `pcap_open_live'<BR>pcap_filter.o(.text+0x1d2):pcap_filter.c: undefined reference to `pcap_compile'<BR>pcap_filter.o(.text+0x1f9):pcap_filter.c: undefined reference to `pcap_close'<BR>pcap_filter.o(.text+0x21d):pcap_filter.c: undefined reference to `pcap_setfilter'<BR>pcap_filter.o(.text+0x244):pcap_filter.c: undefined reference to `pcap_close'<BR>pcap_filter.o(.text+0x271):pcap_filter.c: undefined reference to `pcap_dump_open'<BR>pcap_filter.o(.text+0x2a3):pcap_filter.c: undefined reference to `pcap_close'<BR>pcap_filter.o(.text+0x2d6):pcap_filter.c: undefined reference to `pcap_next_ex'<BR>pcap_filter.o(.text+0x312):pcap_filter.c: undefined reference to `pcap_dump'<BR>pcap_filter.o(.text+0x31f):pcap_filter.c: undefined reference to `pcap_close'<BR>pcap_filter.o(.text+0x32d):pcap_filter.c: undefined reference to `pcap_dump_close'<BR>collect2: ld returned 1 exit status<BR>
make.exe: *** [Pcap_filter.exe] Error 1<BR>
<BR>
sorry for the stupid questions: is it a C or C++ project? howto resolve the problems?<BR><br /><hr />通过 Windows Live Spaces 与朋友轻松共享您的生活。 <a href='http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=zh-cn' target='_new'>立即尝试!</a></body>
</html>