Backward compatability of Libraries.-Collection of common programming errors


  • msdn Problem Description :  Assume we have legacy product with following components. main.exe , x.dll (lib ) , y.dll ( lib ) , z .dll ( lib ) and miscellaneous.dll . Note : this product is very old legacy product ( 10 + years old ) , for which we have source code for all components said above .           But for miscellaneous.dll ( lib ) , we don’t have it’s source code , we have only it’s binaries.We are trying to upgrade this prodcut build from VC++6.0 to VS2005. Since miscellaneous.dll for which we have only binaries,  we can’t build it using VS2005. so thought of going for below solution . Solution approached :

    Backward Compatibility 

    For compatibility between product versions, the library OLDNAMES.LIB maps old names to new names. For instance, open maps to _open. You must explicitly link with OLDNAMES.LIB only when you compile with the following combinations of command-line options:

    • /Zl (omit default library name from object file) and /Ze (the default – use Microsoft extensions)

    • /link (linker-control), /NOD (no default-library search), and /Ze

    For more information about compiler command-line options, see Compiler Reference.

    As said above , i’m planning to build all the components ( main.exe , x.dll , y.dll , z.dll ) with VS2005  with normal compiling options and using /Zl , /Zc:wchar_t- , /Ze options in compile time. Trying to link with necessary options and /NODEFAULT ( to avoid linking with default library )  and OLDNAMES.LIB.Libraries used in linking are : msvcrt.lib , oldnames.lib , kernel32.lib, advapi32.lib , shell32.lib, uuid32.lib , I’m hitting runtime failures, memory corruption problems ,error’s like not able to load CRT properly and CRT_INITIALIZATION routines are called twice. How can I support my old libraries which are built using VA6.0 in my VS2005 application (exe’s & dll’s ) ?


  • msdn1 Using the VC6 compiler you might be able to add a wrapper which is callable from VC8.

    Generally you are better off re-implementing the library.


  • msdn2

    Is there a way to support a old library ( built using VA6.0) for an exe which is built using VS2005 ?


  • msdn3 Using the VC6 compiler you might be able to add a wrapper which is callable from VC8.

    Generally you are better off re-implementing the library.