Hi all,

Am building a WinAPI project in Code::blocks and MinGW. I Downloaded some opensource source code, and tried to compile the snippet haveing done nothing to it, and I get Syntax Error on line 6 for the following code:

IDR_MENU MENU DISCARDABLE
{//BEGIN

    POPUP "File"
        {//BEGIN
            MENUITEM "New",                        IDM_NEW
            MENUITEM "Open",                       IDM_OPEN
            MENUITEM "Save",                       IDM_SAVE
            MENUITEM SEPARATOR
            MENUITEM "Exit",                       IDM_EXIT
        }//END
    POPUP "&Options"
        {//BEGIN
            MENUITEM "&Show Toolbar",               ID_OPTIONS_SHOWTOOLBAR
            , CHECKED
        }//END
}//END

If needed I could try to find the link to the entire program source I've downloaded. What stumps me as that I have done nothing to the code yet :S

Thanks for all of your help,
Mattster

Recommended Answers

All 4 Replies

You have to compile that with a resource compiler, not a c++ compiler. What filename did you give that code? It needs to have .rc extension.

yes, it is named english.rc, do I need to do something seperately then as I was under the impression Code::blocks did it automatically?

Thanks Ancient Dragon

The problem is that all those macris the rc file are not defined. Create a file named english.h and define them there. It doesn't matter what numbers you assign to them as long as there are no duplicates.

// english.h
#define IDM_NEW 1
#define IDM_OPEN 2
#define IDM_SAVE 3
#define IDM_EXIT 100
#define ID_OPTIONS_SHOWTOOLBAR 500

Then include english.h at the top of english.rc

#include "resource.h"
IDR_MENU MENU DISCARDABLE
{//BEGIN

    POPUP "File"
// rest of the rc file goes here

Thanks Ancient Dragon, worked like a breeze!!
Now to deal with the next set of errors lol ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.