VS 2008 - Link against older C runtime

后端 未结 3 908
Happy的楠姐
Happy的楠姐 2020-12-21 10:48

How can I compile using Visual C++ 2008 and link against an older version of the C runtime (I want version 7 instead of 9)?

相关标签:
3条回答
  • 2020-12-21 11:14

    VS is only an IDE. You can use it to build with an older toolset, but it requires some tweaking - you need install two side-by-side VS installation (e.g. VS2008 + vs6) and load with different VSARGS. See this excellent step by step from Bojan Resnik.

    Note that in VS2010 this solution is not applicable - it has a new per project settings->general->"platform toolset". If desired, install this and manually update project settings->VC++ directories (or manually change the default settings).

    0 讨论(0)
  • 2020-12-21 11:25

    I think Microsoft specifically says "don't do this." The thing is, msvcrt.dll is now considered to be part of the OS, not part of any particular app, and not a redistributable. MS may update it with a Service Pack, and may change behavior significantly, as they did with XP SP2. Which would break apps! So... Don't Do It.

    0 讨论(0)
  • 2020-12-21 11:29

    I think what you have to do is find the Linker -> Input property page for your project and tell it to specifically ignore msvcrtd.dll / msvcrt.dll and then explicitly link to the version you want (full path). Not sure what will happen if they have the same name...

    0 讨论(0)
提交回复
热议问题