none
Binary compatibility across Visual C++ versions

    Question

  • Hi,

    I plan to upgrade my VS 2003 to VS 2008, but am worried about compatibility across the two versions. In particular, I have a third party application that is compiled in 2003 (this cannot be changed) and am developing extensions as DLLs for this application. So my question is whether a DLL compiled with Visual C++ 2008 can be called without problems from an application compiled with 2003. Does this work?

    Apart from binary compatibility, I'm mainly worried about the fact that I would end up with two different runtime libraries (the 2003 from the application and the 2008 from my DLLs). Is this a problem?

    Did I forget other common pitfalls?

    Thanks a lot,

    Stefan
    Thursday, April 02, 2009 2:54 PM

Answers

  • In general, there is no binary compatibility between modules complied with different versions of VC. It will most certainly fail if you exchange  library objects (C++ standard library, MFC...) across the boundary.

    Having two versions of the CRT is not necessarily fatal, but it will be if the modules exchange memory across the boundary.

    If the DLL is a COM DLL it will work, because the COM interface is designed for binary compatibility, independent of the compiler.
    David Wilkinson | Visual C++ MVP
    Thursday, April 02, 2009 3:27 PM

All replies

  • In general, there is no binary compatibility between modules complied with different versions of VC. It will most certainly fail if you exchange  library objects (C++ standard library, MFC...) across the boundary.

    Having two versions of the CRT is not necessarily fatal, but it will be if the modules exchange memory across the boundary.

    If the DLL is a COM DLL it will work, because the COM interface is designed for binary compatibility, independent of the compiler.
    David Wilkinson | Visual C++ MVP
    Thursday, April 02, 2009 3:27 PM
  • What about on 64-bit Windows? On Windows XP SP3, we have a case where a 32-bit Visual Studio 2008 SP1 C++ native application succesfully uses a 32-bit COM dll that is built with Visual Studio 2003 SP1. On 64-bit Windows Vista SP1 or Windows 7, this same scenario crashes.

    Is this binary compatibility through COM supported on WOW64?

    thanks,
    -Tom
    Tuesday, December 15, 2009 11:28 PM
  • Duplicate post. Let's leave this thread closed.
    Wednesday, December 16, 2009 12:12 AM