views:

111

answers:

2

I have a code that generates errors on my PC but does't on other PC.I have windows 7 installed and also installed the compatible SDK for windows 7.I have also included the VC directories (from Tools -> option-> vc Diretories) but still the code generates follwing errors.

error C2059: syntax error : 'constant'
error C2238: unexpected token(s) preceding ';'
error C2589: '(' : illegal token on right side of '::'
warning C4091: '' : ignored on left of 'const unsigned int' when no variable is declared
error C2143: syntax error : missing ';' before '::'
error C2059: syntax error : '::'
error C2059: syntax error : 'constant'
error C2238: unexpected token(s) preceding ';'

statement generating error are as following

static const unsigned int MAPVK_VK_TO_CHAR;
const unsigned int KeyLogger :: MAPVK_VK_TO_CHAR = 0x02;
+1  A: 

What's MAPVK_VK_TO_CHAR? I ask because the error might indicate that this is some macro.

Why do you make a plain identifier (not a macro) all caps, anyway? That's just begging for one of the thousands of macros in <windows.h> to trample over it. (Not that not making it all caps would prevent that, since <windows.h> sacrilegiously defines many mixed-case macros...)

Otherwise you would have to paste some minimal, compilable example showing the problem.

sbi
thanks very much for your comment
Ravi shankar
+3  A: 

Try selecting MAPVK_VK_TO_CHAR and hitting F12 to see if the symbol is declared elsewhere.

tfinniga
Thanks for your valuable suggestion !!! My problem solved by trying out your suggestion.
Ravi shankar
If it solved your problem, then why aren't you accepting the answer?
sbi
Sorry for the delay actually I was not able to figer out how to accept the answer and thanks once again for your help.
Ravi shankar