.lib and .dll Backward Compatibility
I currently have a VS6 unmanaged C library that I deliver as either a .lib or .dll. I want to upgrade to VS2010 but I still have users that are in VS6, VS2005, and VS2008.
Can a .lib or .dll built开发者_StackOverflow in VS2010 be used in VS6, VS2005, or VS2008?
Thanks!
It depends on the runtime used to build the libraries. I would typically run into this problem when upgrading solutions from VS2005 to VS2008. The default runtime libraries are different from edition to edition.
When you're building the .lib and .dll, those files are getting linked against those editions of the runtime. Problems will typically be found when you're debugging the program between different VS editions or running it on a non-developer machine when assemblies built with different runtimes attempt to pass information across boundaries. See http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx for details.
I know this is an old post but if anyone else comes across it this may be useful, upgrading from vc6 to vs2010 is a nightmare, but there is an alternative. You can upgrade to VS2010 environment while still using vc6 compiler. the tool you need is Daffodil and can be found here http://daffodil.codeplex.com/
This was our solution because the VS2010 environment is way more productive.
精彩评论