Problem trying to compile an rc file(Code::Blocks)

Im trying to compile an rc file in code::blocks but im getting some errors. Here's the file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "I:/Win32/Win32_SimpleMenu/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"


the compiler says it is compiling the rc file, but it does nothing. After cancling i get:
||can't open file `prompt': No such file or directory|
||preprocessing failed.|
||=== Build finished: 2 errors, 0 warnings ===|


Thanks if you can help!
I only make resource files to give my programs icons. I never use pre-processor directives (#include <blablabla>). I add the rc file to my project (new file, empty file. It will prompt to add to project and name it "whateveryouwant.rc"), what I put in it is this:

MAINICON ICON "icons_filename.ico"

And when it compiles, my program has an icon. I don't know if this helps, but I think it should give you an idea of how they 'behave'.
Creating A Menu In A Win32 Frame Based Code::Blocks SDK Project:

1) Create A Frame Based Code::Blocks SDK Win32 Project. Name it Mnu02. Paste the following code in Main.cpp ...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <windows.h>

#define IDR_MAIN_MENU                        2000
#define IDM_FILE_OPEN                        2100
#define IDM_FILE_EXIT                        2105

long __stdcall WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
 if(message==WM_DESTROY)
    PostQuitMessage(0);
 else
    return DefWindowProc(hwnd, message, wParam, lParam);

 return 0;
}

int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrev, LPSTR lpszArgument, int nCmdShow)
{
 char szClassName[ ] = "CodeBlocksWindowsApp";
 MSG messages;
 WNDCLASS wc;
 HWND hwnd;

 wc.hInstance     = hInstance,                         wc.lpszClassName  = szClassName;
 wc.lpfnWndProc   = WindowProcedure,                   wc.style          = 0;
 wc.hIcon         = LoadIcon(NULL, IDI_APPLICATION),   wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
 wc.lpszMenuName  = MAKEINTRESOURCE(IDR_MAIN_MENU),    wc.cbClsExtra     = 0;
 wc.cbWndExtra    = 0,                                 wc.hbrBackground  = (HBRUSH)COLOR_BACKGROUND;
 RegisterClass(&wc);
 hwnd=CreateWindow(szClassName,"Template",WS_OVERLAPPEDWINDOW,50,50,544,375,HWND_DESKTOP,NULL,hInstance,NULL);
 ShowWindow (hwnd, nCmdShow);
 while(GetMessage (&messages, NULL, 0, 0))
 {
    TranslateMessage(&messages);
    DispatchMessage(&messages);
 }

 return messages.wParam;
}


2) Using either the Project Explorer or the Projects main menu item, add your *.rc file to the project. Name the file Mnu02.rc. Put this file in the same directory as your source code ...

1
2
3
4
5
6
7
8
9
10
11
12
13
/* Mnu02.rc  */
#define IDR_MAIN_MENU             2000
#define IDM_FILE_OPEN             2100
#define IDM_FILE_EXIT             2105

IDR_MAIN_MENU MENU DISCARDABLE
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&Open...",      IDM_FILE_OPEN
        MENUITEM "E&xit",         IDM_FILE_EXIT
    END
END


3) Compile;

4) Complain here if it doesn't work.
If that doesn't work you have some kind of path problems we'll need to discuss. Perhaps we'll try doing some command line compiling to sort it out.
Topic archived. No new replies allowed.