windows – Win32资源文件多个翻译

我想为我的项目使用资源脚本.该项目使用MinGW编译.

RESOURCE.RC:

#include <windows.h>
VS_VERSION_INFO VERSIONINFO
FILEVERSION     1,0
PRODUCTVERSION  1,0
//FILEFLAGSMASK   VS_FFI_FILEFLAGSMASK
//FILEFLAGS       VER_PRIVATEBUILD
FILEOS          VOS_NT_WINDOWS32
FILETYPE        VFT_APP
FILESUBTYPE     VFT2_UNKNOWN
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904E4"
        BEGIN
            //VALUE "Comments",""
            VALUE "CompanyName","Company"
            VALUE "FileDescription","Test for the resource.rc"
            VALUE "FileVersion","1.0"
            VALUE "InternalName","ResourceTest"
            //VALUE "LegalCopyright",""
            //VALUE "LegalTrademarks1",""
            //VALUE "LegalTrademarks2",""
            VALUE "OriginalFilename","ResourceTest.exe"
            VALUE "PrivateBuild","Built by me." //With VS_FF_PRIVATEBUILD
            VALUE "ProductName","resource.rc Test"
            VALUE "ProductVersion","1.0"
        END
    END

    BLOCK "VarFileInfo"
    BEGIN
        /* The following line should only be modified for localized versions.     */
        /* It consists of any number of WORD,WORD pairs,with each pair           */
        /* describing a language,codepage combination supported by the file.      */
        /*                                                                        */
        /* For example,a file might have values "0x409,1252" indicating that it  */
        /* supports English language (0x409) in the Windows ANSI codepage (1252). */
        VALUE "Translation",0x407,1252 //German
        VALUE "Translation",0x409,1252 //U.S. English

    END
END

我使用windres -o Resource.o resource.rc编译它并将其与gcc -mwindows -o Resourcetest.exe Launcher.o Resource.o链接.我的控制台输出:

windres -o Resource.o resource.rc
windres: resource.rc:39: syntax error
make: *** [Resource.o] Error 1

第39行是第二个翻译行:VALUE“Translation”,1252.但是参考MSDN这是当前的.但出了什么问题?

VarFileInfo块中不能有多个VALUE“Translation”行.相反,正如评论所说,你必须有一行包含一个或多个WORD,WORD对.

例如,

VALUE "Translation",1252,1252

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...