当前位置: 动力学知识库 > 问答 > 编程问答 >

c++ - Linking against older version of runtime with newer version of MSVC?

问题描述:

I own VS 2008 Pro, and would like to do compatibility testing with VS 2005's runtime MSVCRT80, but I do not want to buy it just for that. Is there a way to link against MSVCRT80 without getting VS 2005?

Thanks

网友答案:

Official support for native multi-targeting didn't appear until Visual Studio 2010, which allows you to select either v100 or v90 as your "Platform Toolset". There is no such feature in Visual Studio 2008.

There is a discussion here on how one can achieve the same effect in Visual Studio 2008, but it appears you need to have VS 2005 installed on your computer as well in order for this to work. It isn't going to work if you just have the runtime libraries installed because you need the proper version of the compiler and linker, which you'll only have if you install VS 2005.

On that note, I'm not really sure what you mean by "compatibility testing". If you compile your app against v90 in VS 2008, it's not going to work with the older versions of the runtime. You have to compile and link against the version you want your app to use.

Finally, consider whether it's really relevant or not. Since you must include MSVCRT with your application anyway, what's the advantage of trying to link against an older version of the runtime? Just include v90 and be done with it.

网友答案:

Links to a still-working (as of 11 Jan 2011) Microsoft download for Visual C++ Express 2005 can be found here:

  • http://apdubey.blogspot.com/2009/04/microsoft-visual-studio-2005-express.html

This should let you compile against the VS2005 runtime without having to buy anything.

(in case the blogspot article goes away, the link for the .iso is http://go.microsoft.com/fwlink/?linkid=57034).

分享给朋友:
您可能感兴趣的文章:
随机阅读: