views:

23

answers:

2

I have a VC++ project in VS2010 that is linking to some dll's built with VS2008. Works fine until I try to pass MFC objects to the VS2008 dll. The artifact of the VS2010 VC++ project (a .dll) is linking against the latest version of MFC that shipped with VS2010, whereas the VS2008 .dll is linking against the previous version of MFC that shipped with VS2008.

VS2010 VC++ projects have a "Platform Toolset" property that allows either v90 (VS2008) or v100 (VS2010) and that seems like it ought to do the trick. However, the VS2010 VC++ project is being built with /clr (Common Language Runtime Support), which seems to require targeting v4.0 of the .NET Framework - which is not supported in the v90 (VS2008) toolset.

+1  A: 

IIRC, Common Language Runtime should also be supported for .NET 1 through 3.5. You can target a specific .NET version, see here.

I think the Platform toolset would mean either

  • The VS 9.0 or 10.0 compilers and tools
  • the CRT DLL version (and accompanying Visual C++ 2005/2008/2010 runtime redistributable).
rubenvb
The link is for .NET projects (C#, VB.NET, and F#). No C++/CLI options to target. However, the community content section did contain a comment that leads to this gem: http://msdn.microsoft.com/en-us/library/47w1hdab.aspx So, thanks.
pomeroy
A: 

Setting the Platform Toolset option to v90 works if and only if the Targeted framework is 3.5 (or less, I presume).

To change the Targeted framework you have to edit the .vcxproj file directly. To make the change, follow these directions. Note, that the XML element may not be present but the instructions to add the element to the .vcxproj file are in the comments.

pomeroy
Partial credit to rubenvb
pomeroy