C++ Project stopped compiling in VS08 and mixing 8.0/9.0 compiler and linker

Recently I ran into a problem in Visual Studio 2008: a C++ project suddenly didn’t compile anymore. I had successfully compiled it before. I did some research on the internet and eventually found the solution in this forum post.

It turned out that I had installed the Vista Platform SDK from Microsoft’s web site. That version of the SDK is slightly older than the partial version that ships with VS08. The installation changed the registry entry that points to the installed SDK and so the C++ compiler found the older versions of the header files.

The solution to the problem was to change the registry entry HKEY_CURRENT_USER\SOFTWARE\Microsoft\MicrosoftSDKs\Windows\CurrentInstallFolder from from “c:\program files\microsoft sdks\windows\v6.0” to “c:\program files\microsoft sdks\windows\v6.0A”.

I also discovered that object files that are compiled within VS08 (i.e. with the 9.0 compiler) are not backwards compatible, i.e. if you try to link it with the 8.0 linker you get an error message that the debug information is corrupt. The other direction (8.0 compiler, 9.0 linker) works.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s