Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a DLL's "image version" used for (set with the /VERSION Visual C++ linker switch)?

Tags:

dll

visual-c++

I've read the documentation for the Visual C++ /VERSION linker switch ( http://msdn.microsoft.com/en-us/library/h88b7dc8.aspx ) and I understand that this value is shown as the "image version" when you use "dumpbin /headers", but it is not clear to me why you would set the "image version" or what happens if you don't set it and use the default value of "0.0".

Could someone explain to me why you might set the "image version"? Is this value now obsolete?

like image 316
MikeW Avatar asked Nov 05 '22 14:11

MikeW


1 Answers

Here is the best explanation I could find: 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.

The last sentence seems to imply this is used as a last check when loading DLLs (when your EXE binds a specific DLL version). That seems to align with the behavior that was seen with Vista's Program Compatibility Assistant (PCA) mentioned in the comment above.

like image 180
Joe Bane Avatar answered Nov 10 '22 16:11

Joe Bane