Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
I have 2 VC++ projects compiling into DLLs (projA, projB). Both projects have dependencies on other DLLs.
projA depends on depA1.dll and depA2.dll - all those dlls are compiled in VS2008.
projB depends on projA, depB1.dll and depB2.dll and are compiled in VS2012 (except projA which was compiled with VS2008).

When does the visual studio version become a dependency by itself, so I need to build all dlls using the same version of VS?
Does this matter if in projB i load projA using LoadLibrary instead of linking with it?

Thanks.
Posted
Comments
Philippe Mori 5-May-15 19:33pm    
It is hard to tell... it really depends on what you do and what form of communication you have between libraries. In particular, you can have problems if you use incompatible options accros the boundaries.
Albert Holguin 6-May-15 18:58pm    
In my personal experience... I've never had luck using DLL's that were compiled with different versions of VisualStudio (more specifically, as other pointed out, the underlying libraries used that you link your software to). I never had enough motivation to figure exactly what part didn't quite match up, but in general... there are issues there of concern.

hi,
with every release of VisualStudio, changes are made to the compiler and the related CRT dlls (called Visual C++ Redistributables), so yes it does matter which VS you built the dlls with. Its better to have all the dlls built with the same compiler .

hope this helps !!
 
Share this answer
 
Comments
Albert Holguin 6-May-15 18:59pm    
Yep, I've had some of issues trying to do this in the past.
Of course Visual Studio itself is not a dependency; it is just an IDE which does not participate in runtime.

At the same time, I don't know what you are using. You could have created the dependency of so called "Visual C++ Redistributable for Visual Studio". By the license for this package, you can freely re-distribute it with your application. Please see, for example: https://www.microsoft.com/en-us/download/details.aspx?id=29[^].

You can find such packages for all VS versions. By the way, if you have doubts on your dependencies, you can use Microsoft Dependency Walker, depends.exe:
http://en.wikipedia.org/wiki/Dependency_Walker[^],
http://wiki.imacros.net/Dependency_Walker[^].

—SA
 
Share this answer
 
Comments
Albert Holguin 6-May-15 18:59pm    
See my comment above... I've personally had issues with this.
Sergey Alexandrovich Kryukov 6-May-15 21:27pm    
Agree. That's why I mentioned "such packages for all VS versions" and provided the link to 2008 version the inquirer needs.
—SA
Albert Holguin 7-May-15 10:35am    
Yeah but I think even if you have all dependencies present, compiling a dll in one version and an executable in another will make them incompatible. I had this issue with Studio 6 and 2008.... then saw it again when trying to roll from 2008 to 2010. Again, I wasn't exactly sure what component caused the problem and it didn't bother me enough to try to find out.
Sergey Alexandrovich Kryukov 7-May-15 13:06pm    
I agree, without "but". I actually meant that.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900