3

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 Answers3

5

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...

i_am_jorf
  • 53,608
  • 15
  • 131
  • 222
3

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).

Hertzel Guinness
  • 5,912
  • 3
  • 38
  • 43
  • Hi, i have installed Daffodil as per your comment, but I am unsure of what to do with the VC++ directories. Could you possibly give me some advice on that please? – Vermin Feb 22 '12 at 13:05
  • Well, IIRC, after installing that tool you only need to select the toolchain (rather then modifying the VC directories...). See http://blogs.msdn.com/b/vcblog/archive/2009/12/08/c-native-multi-targeting.aspx under "How to enable native Multi-targeting?". – Hertzel Guinness Feb 22 '12 at 16:26
1

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.

Cheeso
  • 189,189
  • 101
  • 473
  • 713
  • 1
    if you build ur application using vs2008 it will rely on msvcr09.dll which exists in winsxs folder not in the windows\system32 folder – Ahmed Apr 08 '09 at 15:11
  • I don't know what question you're answering but certainly it's not the one asked by Jimmy here... – Piotr Dobrogost Feb 26 '11 at 19:35