使用版本信息编译DLL [英] Compiling DLL with Version Information

查看:71
本文介绍了使用版本信息编译DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要从命令行在Windows DLL中编译版本信息的步骤.我一直在查看VersionInfo文件,但无法弄清楚如何将它们链接到DLL.

What steps are needed to compile Version Information inside a windows DLL from the command line. I have been looking at VersionInfo files, but could not figure out how to link them to the DLL.

谢谢

推荐答案

您需要创建一个版本资源并将其添加到您的项目中.这可以在Visual Studio中轻松完成.在VS 2008中,右键单击项目的文件夹,选择添加",然后在"Visual C ++"下选择资源文件"(不是资源模板),在刚刚创建的资源文件中,您将能够添加如下所示的版本资源这个:

You need to create a version resource and add it to your project. This can be very easily done from within visual studio. in VS 2008, right click a folder of the project, choose add and under "Visual C++" select "Resource File" (not resource template), in the resource file just created you'll be able to add a version resource which looks like this:

VS_VERSION_INFO VERSIONINFO
 FILEVERSION 1,0,0,1
 PRODUCTVERSION 1,0,0,1
 FILEFLAGSMASK 0x17L
#ifdef _DEBUG
 FILEFLAGS 0x1L
#else
 FILEFLAGS 0x0L
#endif
 FILEOS 0x4L
 FILETYPE 0x1L
 FILESUBTYPE 0x0L
BEGIN
    BLOCK "StringFileInfo"
    BEGIN
        BLOCK "040904b0"
        BEGIN
            VALUE "FileDescription", "XXX Application"
            VALUE "FileVersion", "1, 0, 0, 1"
            VALUE "InternalName", "XXX"
            VALUE "LegalCopyright", "Copyright (C) 2010"
            VALUE "OriginalFilename", "XXX.exe"
            VALUE "ProductName", "XXX Application"
            VALUE "ProductVersion", "1, 0, 0, 1"
        END
    END
    BLOCK "VarFileInfo"
    BEGIN
        VALUE "Translation", 0x409, 1200
    END
END

在命令行中,您需要使用rc.exe,资源编译器,然后将结果链接到您的dll.

From the command line you'll need to use rc.exe, the resource compiler and then link the result to your dll.

这篇关于使用版本信息编译DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆