[Winpcap-users] dumb question ;(

Gianluca Varenni gianluca.varenni at cacetech.com
Thu Mar 30 21:55:25 GMT 2006


Uhm, quite strange...

Are you using precompiled headers (I think that by default an MFC project in 
VS used precompiled headers).

If so, you need to add the #include <pcap.h> directive into stdafx.h (or 
similar file).

Have a nice day
GV



----- Original Message ----- 
From: "Alex Radetsky" <rad at rad.kiev.ua>
To: "Gianluca Varenni" <gianluca.varenni at cacetech.com>
Cc: <winpcap-users at winpcap.org>
Sent: Thursday, March 30, 2006 1:00 PM
Subject: Re[2]: [Winpcap-users] dumb question ;(


>
> Hello!
>
> Yes, of course.
>
> --------------------Configuration: TCounter - Win32 
> Debug--------------------
> Compiling...
> TCounterDlg.cpp
> E:\$HOME\RAD\TCounter\TCounterDlg.cpp(130) : error C2065: 'pcap_if_t' : 
> undeclared identifier
> E:\$HOME\RAD\TCounter\TCounterDlg.cpp(130) : error C2065: 'alldevs' : 
> undeclared identifier
> E:\$HOME\RAD\TCounter\TCounterDlg.cpp(130) : warning C4552: '*' : operator 
> has no effect; expected operator with side-effect
> Error executing cl.exe.
>
> TCounter.exe - 2 error(s), 1 warning(s)
>
> Code:
> // TCounterDlg.cpp : implementation file
> //
>
> #include <pcap.h>
>
> .
> .
> .
>
> BOOL CTCounterDlg::OnInitDialog()
> {
>        CDialog::OnInitDialog();
>        .
>        .
>        .
>        pcap_if_t *alldevs;
>        return TRUE;
> }
>
>
>> Can you please post the exact error given by the compiler?
>
>> Have a nice day
>> GV
>> ----- Original Message ----- 
>> From: "Alex Radetsky" <rad at rad.kiev.ua>
>> To: <winpcap-users at winpcap.org>
>> Sent: Thursday, March 30, 2006 8:25 AM
>> Subject: [Winpcap-users] dumb question ;(
>
>
>>> Hello, everybody!
>>>
>>> Please excuse me for my very dumb question, Ok?
>>>
>>> First, I install
>>> https://www.winpcap.org/install/bin/WinPcap_3_1.exe
>>> on my Windows XP machine.
>>> Second, I download WpdPack 3.1 from winpcap.org, following the
>>> instructions
>>> I was unpacking it and place to desired folder.
>>>
>>> I use Visual C++ 6.0 for applications creating. In some my class
>>> method I declared
>>>
>>> pcap_if_t *alldevs;
>>>
>>> and got "undeclared identifier" error from compiler.
>>>
>>> Following the instructions from WpdPack documentaion I insert
>>> #include <pcap.h> to my .cpp file, adding wpcap.lib as additional
>>> libraries, adding "include" and "lib" directories to additional
>>> directories for MSVC (Tools/Options/Directories).
>>>
>>> But still got the "undeclared identifier" error.
>>> error C2065: 'pcap_if_t' : undeclared identifier
>>>
>>> Where I was wrong? It seems like "pcap.h" is not including,
>>> but why compiler does not say it to me?
>>>
>>> Can anyone tell me where I was wrong? Some FAQ?
>>>
>>> I understand that is very dump question and I can't find answer via
>>> google :)
>>>
>>> PS. While reading mail archive I was added HAVE_REMOTE and WPCAP to
>>> the preprocessor definitions, but still no luck?
>>>
>>> Have some ideas? Thank you very much.
>
>
> -- 
> /me from ~
> rad at rad.kiev.ua
> 



More information about the Winpcap-users mailing list