我已阅读 Visual C++/VERSION 链接器开关 ( http://msdn.microsoft.com/en-us/library/h88b7dc8.aspx ) 的文档,并且我知道当您使用“dumpbin/headers”时,该值显示为“图像版本”,但不清楚对我来说,为什么要设置“图像版本”,或者如果不设置它并使用默认值“0.0”会发生什么。
有人可以向我解释一下为什么要设置“图像版本”吗?这个值现在已经过时了吗?
最佳答案
这是我能找到的最好的解释:http://www.dependencywalker.com/help/html/version_numbers.htm
IMAGE VERSION This value is set by the developer of the module by using the VERSION statement in their DEF file or by using the /VERSION linker option. It usually represents the version of the module or product that the module is part of, but can contain any value since it is up to the developer to set it. If the developer does not specify a version, then this value will default to 0.0. This value may be used as a last resort when comparing two modules to check which module is newer.
最后一句似乎暗示这是加载 DLL 时(当您的 EXE 绑定(bind)特定 DLL 版本时)的最后检查。这似乎与上面评论中提到的 Vista 程序兼容性助手 (PCA) 的行为一致。
关于visual-c++ - DLL 的 "image version"有何用途(使用/VERSION Visual C++ 链接器开关设置)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7403188/