简体   繁体   中英

Windres errors in .rc file

When I try to use windres (Included with MinGW) to compile my .rc file using the tutorial here , it gives me the following error (I put "windres my.rc -O coff -o my.res" into the command line):

cpp: Too many arguments
windres: my.rc:1: syntax error

my.rc is as follows:

1 ICON "C:\Users\Owner\Desktop\LonelyPlanet\LonelyPlanetIcon.ico"
2 VERSIONINFO
FILEVERSION     1,0,0,0
PRODUCTVERSION  1,0,0,0
BEGIN
  BLOCK "StringFileInfo"
  BEGIN
    BLOCK "040904E4"
    BEGIN
      VALUE "CompanyName", "Neil Flodin"
      VALUE "FileDescription", "A game I made at iD tech camp!"
      VALUE "FileVersion", "1.0"
      VALUE "InternalName", "Lonely_Planet"
      VALUE "LegalCopyright", "Copyright(c) Neil Flodin All Rights Reserved"
      VALUE "OriginalFilename", "Lonely Planet.exe"
      VALUE "ProductName", "Lonely Planet"
      VALUE "ProductVersion", "1.0"
    END
  END

  BLOCK "VarFileInfo"
  BEGIN
    VALUE "Translation", 0x409, 1252
  END
END

Is there anything weird that I'm doing with my rc file/command line input, and if so, how could I make windres compile it?

-Neil

#include <winresrc.h>
IDR_MAINFRAME           ICON                    "main.ico"
VERSIONINFO
...
END

add resource.h

#define IDR_MAINFRAME                   128

I have provide a possible solution to a similar problem ( Windres syntax error ) posted 4 years ago from today.

I hope it can helps. The point is that you can try to compile the .rc file in the same way, but using Cygwin , and obtaing a .o file instead a .res one, that you can use in the linking process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM