windows 如何设置用 C 构建的 DLL 版本,用 CL.EXE 编译?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1574953/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I set the version of a DLL built in C, compiled with CL.EXE?
提问by Cheeso
If I compile the source for a C-language DLL with CL.exe, how do I set the file properties including File version Product name, Product version, Copyright and so on, so that I can view these properties in Windows Explorer?
如果我使用 CL.exe 编译 C 语言 DLL 的源代码,如何设置文件属性,包括文件版本产品名称、产品版本、版权等,以便我可以在 Windows 资源管理器中查看这些属性?
In a .NET application written in C#, I could do this with assembly attributes like [assembly: AssemblyVersion("1.2.3.4")]
. How do I do this in a C-language project?
在用 C# 编写的 .NET 应用程序中,我可以使用像[assembly: AssemblyVersion("1.2.3.4")]
. 如何在 C 语言项目中执行此操作?
回答by Pratik Bhatt
Embed a VersionInfo resource into your dll/application.
将 VersionInfo 资源嵌入到您的 dll/应用程序中。
http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx
http://msdn.microsoft.com/en-us/library/aa381058%28VS.85%29.aspx