954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

GUI: 3 C:\Dev-Cpp\lolLOLlol.cpp expected `,' or `;' before numeric constant

Hey. The title displays the error and i was just wondering how i could fix it. Thanks!

#include "resource.h"

IDR_MYMENU MENU
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "E&xit", ID_FILE_EXIT
    END

    POPUP "&Stuff"
    BEGIN
        MENUITEM "&Go", ID_STUFF_GO
        MENUITEM "G&o somewhere else", 0, GRAYED
    END
END

IDI_MYICON ICON "menu_one.ico"
Code Shark
Newbie Poster
14 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

you forgot a ";" ^^
at what line does it expect but not find?

Tigran
Junior Poster in Training
92 posts since Jun 2008
Reputation Points: 24
Solved Threads: 8
 

c++ compilers don't know how to compile resource files. Use a resource compiler for that.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

I'm not sure what language that is, but its not C or C++, unless the contents of "resource.h" happen to be an extremely nasty set of macros and #define statements.

If we knew what was inside resource.h. we might be able to give a better answer

Bench
Posting Pro
577 posts since Feb 2006
Reputation Points: 307
Solved Threads: 63
 

I'm not sure what language that is, but its not C or C++, unless the contents of "resource.h" happen to be an extremely nasty set of macros and #define statements.

If we knew what was inside resource.h. we might be able to give a better answer

That is a resource file that defines MS-Window GUI resources such as menu, dialog boxes, etc. resource.h just contains define's for integers that are used in the resource file and elsewhere in the c++ code. Resource files are compiled with resource compilers, not c++ compilers.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Dev-C++ 4.9.9.2 will compile this. I have done it before. Check your resource.h for any missing semicolons.

TheBeast32
Posting Whiz in Training
236 posts since Dec 2007
Reputation Points: 79
Solved Threads: 6
 

Dev-C++ is not a compiler -- its an IDE that calls other programs to compile the files. And there should be no semicolons in resource.h

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

1. There could be a missing semicolon in resource.h if he didn't use all #define macros, and declared something like "long something" in it. It would look weird, but there still could be one.

2. Take a look. His error is "3 C:\Dev-Cpp\lolLOLlol.cpp expected `,' or `;' before numeric constant". C:\Dev-Cpp\ is Dev-C++'s default installation directory. That must mean he's using it right? Also, I'm not saying that a C++ compiler could do that. I'm just saying that he must have an error in resource.h or something.

TheBeast32
Posting Whiz in Training
236 posts since Dec 2007
Reputation Points: 79
Solved Threads: 6
 

I will agree that resource.h might contain some crap that the resource compiler doesn't understand. Only the op can know that, and he has posted nothing about it. The *.h file could be just missing the // for start of comment. But since we're just guessing, there is no point discussing this any more.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

Post your resource.h Code Shark, so we can see if there's anything wrong.

TheBeast32
Posting Whiz in Training
236 posts since Dec 2007
Reputation Points: 79
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You