<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7600.16625"></HEAD>
<BODY style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
id=MailContainerBody leftMargin=0 topMargin=0 CanvasTabStop="true"
name="Compose message area">
<DIV><FONT face=Calibri>The issue is definitely related to the order of the
include files. I haven't developed an MFC-based app in Visual Studio 6 in a very
long time (I don't even have it installed on my machine any more, I use VS2005),
so I tried a bit with VS2005.</FONT></DIV>
<DIV><FONT face=Calibri>In my case, I had to include pcap.h after afxwin.h. That
did the trick.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Let me know if this solves your issue.</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Have a nice day</FONT></DIV>
<DIV><FONT face=Calibri>GV</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><BR></DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=tchapman131@gmail.com
href="mailto:tchapman131@gmail.com">Tom Chapman</A> </DIV>
<DIV><B>Sent:</B> Wednesday, October 13, 2010 10:37 AM</DIV>
<DIV><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org">winpcap-users@winpcap.org</A> </DIV>
<DIV><B>Subject:</B> Re: [Winpcap-users] Using WinPcap with Visual C++ version
6.</DIV></DIV></DIV>
<DIV><BR></DIV><BR>The answer I need is: How do I use WinPcap with version 6
Visual C++? The answer you have given is a generic answer that does not address
the fact that I am working using a standard Visual C++ project. When you work in
this VERY STANDARD AND WELL KNOWN project framework, you do not have easy
control of what gets included where, when and in what order. <BR><BR>I inserted
#include "pcap.h" in the project's StdAfx.h. See bottom of this post. Now I
receive a different error that I don't understand. The error points to a line in
pcap-stdinc.h that seems OK to me. The error leads me to believe that something
previous to the tagged line is wrong. I don't understand the problem
here.<BR><BR>Please help
me.<BR><BR>----------------------------------------------------------------------------<BR>When
I compile the project I receive the following errors:<BR><BR><BR><BR>Deleting
intermediate files and output files for project 'Core - Win32
Debug'.<BR>--------------------Configuration: Core - Win32
Debug--------------------<BR>Compiling
resources...<BR>Compiling...<BR>StdAfx.cpp<BR>c:\projects\thirdparty\winpcap\pcap-stdinc.h(79)
: error C2144: syntax error : missing ';' before type 'unsigned
int'<BR>c:\projects\thirdparty\winpcap\pcap-stdinc.h(79) : fatal error C1004:
unexpected end of file found<BR>Error executing cl.exe.<BR>Creating browse info
file...<BR>BSCMAKE: error BK1506 : cannot open file '.\Debug\StdAfx.sbr': No
such file or directory<BR>Error executing
bscmake.exe.<BR><BR>----------------------------------------------------------------------------<BR>Below
is my stdafx.h include file.I think this is fairly standard.<BR><BR><BR>//
stdafx.h : include file for standard system include files,<BR>// or
project specific include files that are used frequently,
but<BR>// are changed
infrequently<BR>//<BR><BR>#if
!defined(AFX_STDAFX_H__A546186A_092A_4B6A_9008_75C782FFF93B__INCLUDED_)<BR>#define
AFX_STDAFX_H__A546186A_092A_4B6A_9008_75C782FFF93B__INCLUDED_<BR><BR>#if
_MSC_VER > 1000<BR>#pragma once<BR>#endif // _MSC_VER >
1000<BR><BR>#define _WIN32_WINNT 0x0400<BR>#pragma warning(disable :
4786)<BR><BR>#define VC_EXTRALEAN //
Exclude rarely-used stuff from Windows headers<BR><BR>#include
<afx.h><BR>#include "pcap.h"<BR>#include
<afxwin.h> // MFC core and
standard components<BR>#include
<afxext.h> // MFC
extensions<BR>#include <afxdtctl.h>
// MFC support for Internet Explorer 4 Common Controls<BR>#ifndef
_AFX_NO_AFXCMN_SUPPORT<BR>#include <afxcmn.h>
// MFC support for Windows Common
Controls<BR>#include <afxsock.h><BR>#endif //
_AFX_NO_AFXCMN_SUPPORT<BR><BR>#include <iostream><BR><BR>// TODO:
reference additional headers your program requires
here<BR><BR><BR>//{{AFX_INSERT_LOCATION}}<BR>// Microsoft Visual C++ will insert
additional declarations immediately before the previous line.<BR><BR>#endif //
!defined(AFX_STDAFX_H__A546186A_092A_4B6A_9008_75C782FFF93B__INCLUDED_)<BR><BR><BR>
<DIV class=gmail_quote>On Wed, Oct 13, 2010 at 10:55 AM, Gianluca Varenni <SPAN
dir=ltr><<A
href="mailto:gianluca.varenni@cacetech.com">gianluca.varenni@cacetech.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV style="PADDING-LEFT: 10px; PADDING-RIGHT: 10px; PADDING-TOP: 15px"
name="Compose message area">
<DIV><FONT face=Calibri>Tom,</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>you need to make sure that pcap.h is included before
winsock.h</FONT></DIV>
<DIV><FONT face=Calibri></FONT> </DIV>
<DIV><FONT face=Calibri>Have a nice day</FONT></DIV>
<DIV><FONT face=Calibri>GV</FONT></DIV>
<DIV style="FONT: 10pt Tahoma">
<DIV><FONT size=3 face=Calibri></FONT><BR></DIV>
<DIV style="BACKGROUND: rgb(245,245,245)">
<DIV><B>From:</B> <A title=tchapman131@gmail.com
href="mailto:tchapman131@gmail.com" target=_blank>Tom Chapman</A> </DIV>
<DIV><B>Sent:</B> Wednesday, October 13, 2010 8:41 AM</DIV>
<DIV><B>To:</B> <A title=winpcap-users@winpcap.org
href="mailto:winpcap-users@winpcap.org"
target=_blank>winpcap-users@winpcap.org</A> </DIV>
<DIV><B>Subject:</B> [Winpcap-users] Using WinPcap with Visual C++ version
6.</DIV></DIV></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV><BR></DIV>I have an existing MFC project that uses Visual C++ Version 6.
I want to add WinPcap to this project. In one of my .cpp files, I added
#include "pcap.h". When this file is compiled I receive a bunch of compiler
errors. Apparently WinPcap includes winsock2.h and this conflicts with
winsock.h that the compiler is already using. I can't find how to make this
work. In older posts on the web, I have found various "ideas" people have
posted as possible solutions. Many of these posts are not my exact situation.
None of these have worked for me.<BR><BR><U><B>How can I get the compiler to
work with WinPcap?</B></U><BR><BR>FYI: I have installed the platform SDK Aug
2004 edition. Do I need to register this somehow within Visual C++? How? Where
in the menus?<BR><BR><BR>Thank you for helping me.<BR><BR><BR>Below are the
first few errors that I receive:<BR><BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(99) : error C2011: 'fd_set' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(134) : warning C4005: 'FD_SET' : macro
redefinition<BR> c:\program
files\microsoft visual studio\vc98\include\winsock.h(83) : see previous
definition of 'FD_SET'<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(143) : error C2011: 'timeval' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(199) : error C2011: 'hostent' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(212) : error C2011: 'netent' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(219) : error C2011: 'servent' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(226) : error C2011: 'protoent' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(310) : error C2011: 'in_addr' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(368) : error C2011: 'sockaddr_in' : 'struct'
type redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(378) : error C2011: 'WSAData' : 'struct' type
redefinition<BR>c:\program files\microsoft visual
studio\vc98\include\winsock2.h(430) : warning C4005: 'SO_DONTLINGER' : macro
redefinition<BR> c:\program
files\microsoft visual studio\vc98\include\winsock.h(391) : see previous
definition of 'SO_DONTLINGER'<BR><BR></DIV></DIV>
<P></P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users
mailing list<BR><A href="mailto:Winpcap-users@winpcap.org"
target=_blank>Winpcap-users@winpcap.org</A><BR><A
href="https://www.winpcap.org/mailman/listinfo/winpcap-users"
target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR></DIV><BR>_______________________________________________<BR>Winpcap-users
mailing list<BR><A
href="mailto:Winpcap-users@winpcap.org">Winpcap-users@winpcap.org</A><BR><A
href="https://www.winpcap.org/mailman/listinfo/winpcap-users"
target=_blank>https://www.winpcap.org/mailman/listinfo/winpcap-users</A><BR><BR></BLOCKQUOTE></DIV><BR>
<P>
<HR>
<P></P>_______________________________________________<BR>Winpcap-users mailing
list<BR>Winpcap-users@winpcap.org<BR>https://www.winpcap.org/mailman/listinfo/winpcap-users<BR></BODY></HTML>