A really stupid error about something defined???

This is a discussion on A really stupid error about something defined??? within the Windows Programming forums, part of the Platform Specific Boards category; Hi all! I've got the following: Code: #define BC 60001; .... wmID=LOWORD(pMsgDet->wParam); if(wmID==BC){ ... then the thing throws a wobbler ...

  1. #1
    Registered User
    Join Date
    May 2003
    Posts
    44

    A really stupid error about something defined???

    Hi all!

    I've got the following:


    Code:
    #define BC 60001;
    ....
    wmID=LOWORD(pMsgDet->wParam);
    if(wmID==BC){
    ...

    then the thing throws a wobbler pointing to the:

    if(wmID==BC){

    line with the following errors:

    error C2143: syntax error : missing ')' before ';'
    error C2059: syntax error : ')'


    However, if I change that to:

    if(wmID==60001){

    then it compiles okay with no errors, but then of course it isn't handled correctly.


    Thanks!!!

  2. #2
    King of the Internet Fahrenheit's Avatar
    Join Date
    Oct 2001
    Posts
    128
    Remove the semicolon in the #define and you will be fine.

  3. #3
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    Yep, preproccessor commands don't end in semi-colons (unless you explicitly want the semicolon there).

  4. #4
    Registered User
    Join Date
    May 2003
    Posts
    44
    Thanks guys! I'll remember that advice!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking problems in Visual Studio
    By h3ro in forum C++ Programming
    Replies: 5
    Last Post: 03-04-2008, 02:39 PM
  2. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM
  3. Variables already defined while linking.
    By xconspirisist in forum C++ Programming
    Replies: 2
    Last Post: 06-10-2005, 06:20 AM
  4. DLL compiling question
    By Noose in forum Windows Programming
    Replies: 2
    Last Post: 12-16-2004, 07:16 AM
  5. Header files
    By borland_man in forum C++ Programming
    Replies: 14
    Last Post: 02-22-2002, 04:30 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21