views:

231

answers:

2

We are using VS2008 team edition and TFS for check-out/check-in, change control, etc, for C# WinForms and ASP.Net projects (plus we have the previous Visual Studio versions back to version 6 availble).

We just inherited a VC++ version 6 MFC-based application. Migrating it to a later version of the VC++ compiler (as well as Visual Studio and Windows) is not in the cards just yet. The target executables must run on NT 4, 2000, and XP (yes, NT).

Just for fun, we've tried a straight migration just from VC++ 6 to VS 2003, but the MFC libraries have changed just enough to throw a zillion warnings and errors.

In addition to brushing-up on C++ and MFC (it's been a while), we need to determine how to fit it into our environment. Ideally, we would like to build the application within the VS2008 IDE to utlize TFS change control and workflows, but have VS2008 use the version 6 compiler and MFC libraries. Is this possible? Can Visual Studio 2008 be wired to build against earlier versions of the C++ compiler and MFC libraries or are we stuck maintaining this application in VC++ version 6 using SourceSafe?

A: 

I'm not sure about substituting the compiler per se, but you can change the target folders for includes so that that the new compiler links to the older .lib and .h files. That should pretty much take care of the compatibility issues.

You can find all those configuration options in the project settings.

UPDATE

It seems that you can change the compiler executable as well as the Library Files and the Include Files. Look for the following setting in your project settings:

  • Library Files location (.lib files)
  • Include Files location (.h files)
  • Executable Files location (should be changed to point to VC++ 6.0 compiler and linker location)
Miky Dinescu
+2  A: 

Yes, it is possible. The trick is to setup the environment for the old version and then start VS2008 instructing it to use the current environment.

This is a batch file that I used to run VS2008 and compile with VC 6:

call "d:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
start "" "D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" /useenv
Bojan Resnik
This means you'd have to have VC6 installed anyway, right?
djeidot
Of course - in order to use the VC6 compiler and libs, as OP wants, you have to install VC6.
Bojan Resnik
I had an issue with the /useenv, but silly me I did not install VS 2008 C++, only 6.0. I searched the web and some other people have the same issue, so in case they stumble upon this post, just install C++ 2008 as well.
Marthinus