Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I link a .rc (resource) file when compiling a win32 app with gcc through command line?

I have been following the forgers win32 tutorial, specifically this section as of this moment, and was wondering how you would link the .rc(resource) file when compiling a win32 program? (I'm compiling through command line).

I was reading this article which says you could do something like this windres chocolate-doom-res.rc chocolate-doom-res.o and compile this waygcc other.o files.o etc.o chocolate-doom-res.o -o chocolate-doom.exe

But when I tried doing windres res.rc res.o (res.rc is my resource file) it gives me this windres: res.rc:3: syntax error

res.rc

#include "resource.h"
IDR_MYMENU
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"

Any ideas?.

like image 351
silent Avatar asked Nov 27 '10 11:11

silent


1 Answers

You're missing the MENU resource type. You should write:

#include "resource.h"
IDR_MYMENU MENU
BEGIN
.
.
.
END
like image 64
Frédéric Hamidi Avatar answered Sep 19 '22 14:09

Frédéric Hamidi