Can I use Visual Studio 2010's C++ compiler with Visual Studio 2008's C++ Runtime Library?

后端 未结 8 1201
走了就别回头了
走了就别回头了 2020-11-27 02:51

I have an application that needs to operate on Windows 2000. I\'d also like to use Visual Studio 2010 (mainly because of the change in the definition of the auto

8条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 03:14

    Option 1 - create a modified version of the 2010 runtime that redirects the problem API calls to a DLL that you supply. I don't know how easy or hard this would be - hopefully just a minor tweak to the symbol table, but it depends on the file format - and you're very likely to run into the reverse engineering clause of the license, of course.

    Option 2 - Compare the exported symbols in two different versions of the runtime libs. If the symbols are the same, you have good odds of compatibility - though no guarantees. Its even possible that the lib file formats are different.

    Option 3 - Check whether you can get access to runtime sources through the MSDN or similar, specifically in order to create a patched version.

    Option 4 - Check whether you can use the 2010 compiler, but an older linker, perhaps configured in your solutions as a custom build step. Again, this depends on whether the obj and lib files are the same file format - but you may be able to write a small utility to patch simple differences like version numbers in a header. The older linker should have no problem linking in the older runtime - assuming the objs from the new compiler are compatible with it.

    Option 5 - build DLLs in 2010 that don't need their own runtime, but which are loaded and hosted by an application built using the older compiler. Achieving the "no runtime" requirement for your DLLs may mean a lot of your libraries must be built in the hosting application, of course, and you may need to provide your own interfaces (via the host application) to library functions you need to work with - especially memory allocation stuff.

    Options worth checking, but I'm sure you already thought of them all - sorry I have no idea whether any of them will work - or whether they'll almost work but cause intermittent problems.

提交回复
热议问题