1

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;
2
  • I think we need to see more code than that. I would guess that you have a macro defined somewhere Commented Sep 2, 2009 at 15:28
  • Thanks for your valuable suggestion !!! Commented Sep 3, 2009 at 12:17

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

3 Comments

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

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.