05 Maret 2012 5:31
Hi, if a library has been created by compiling the code using VC2010 (Visual Studio 2010), can that library be linked and used with an application compiled using VC9 (Visual Studio 2008), in VS2008 runtime?
That is, a software library has been built using VC2010. But the application is built using Visual Studio 2008 and the runtime also is VS2008. (Not upgraded to VS2010). Can the application use that software library?
05 Maret 2012 11:07Moderator
you can create libraries in VS 2010 and use them in VS2008 without problems. Just make sure that you target a .Net Framework that is also supported in VS 2008. If you target the .Net Framework 4 in VS2010, VS 2008 cannot use the library (It simply targets a framework that VS2008 is not supporting).
Ok, there might be some workarounds. http://blogs.microsoft.co.il/blogs/arik/archive/2011/05/30/how-to-use-a-net-4-based-dll-from-net-2-based-application.aspx describes a possibility how you could use a .Net 4 based DLL from .Net 2 but if possible you should try to avoid such things.
With kind regards,
05 Maret 2012 12:25Thanks very much, Konrad. Just to confirm, the library is built with the C compiler. Does it hold good even then? (Not using .NET framework)
05 Maret 2012 13:04Moderator
I have to confess that I am not a C++ user (switched to C# short time before Microsoft published Visual Studio 2003). So maybe my knowledge is a little outdated.
In general everythign should work fine when it is compiled into libraries. You should just make sure that you do not use any new features inside the header files that you have to include in your code (that should be clear, because the old Compiler will not be able to understand the new stuff!).
But everything that is compiled into the Library itself should work without any problem at all because that is simply binary code and the system will not care how it was created.
The new stuff / changes with Visual C++ 2010 can be found at http://msdn.microsoft.com/en-us/library/dd465215.aspx.
With kind regards,