Changing framework for Visual Studio 2008

I haven’t done much Windows work since the days of NT 4. The majority of my work since then has been in XCode and various embedded worlds. My time away from Windows has been pleasant. But I must return for some work. Seems like the best place to start would be building the Introjucer, since the project is already there.

I’ve got Win7 with Visual Studio 2008. My first effort to build got me to this error in juce_graphics.cpp:

#if JUCE_USE_DIRECTWRITE /* If you hit a compile error trying to include these files, you may need to update your version of the Windows SDK to the latest one. The DirectWrite and Direct2D headers are in the version 7 SDKs. */ #include <d2d1.h> #include <dwrite.h> #endif
So I went out and grabbed the Net 3.51 and Net 4.00 SDKs, along with assorted service packs that were needed for Visual Studio 2008. Spent hours installing. I still have the same failure as before: an error bemoaning the absence of d2d1.h. I’ve gone digging through the project properties and found that the selection for Targeted Framework says .NET Framework 2.0. The choice is greyed out. I’ve gone digging through forums and found various possible corrections, but none seem to point to options that actually exists.

I’m sure this sounds like a rookie mistake and I suppose it is. But if anyone could point me toward a solution, I’ll gladly accept any insults that come along with it.

You need the Windows platform SDK not .Net

[quote=“otristan”]You need the Windows platform SDK not .Net[/quote]

Yeah, that was one of the other things I’d installed, along with the Visual Studio Service Pack 1. Just to be sure, I applied them all again. I went back through my update history and discovered that I’d actually installed all the SDKs weeks ago. So I shouldn’t have encountered this problem in the first place. Perhaps there’s something in the way the Introjucer solution/project are put together (nothing is write-protected, by the way).

Why not install .Net framework 2.0?

[quote=“AlexY”]Why not install .Net framework 2.0?[/quote]
I’m running Win7 as 64 bits, and I can’t install 2.0 on 64 bit.

This raises the question: is this build doomed to fail on a 64-bit system? I’m so used to Mac software running smoothly with a mix of 32/64 bit that I forget Windows is considerably cruder in that regard.

Try this download if you haven’t:


Are you using the express edition?
If so, there is a bug in the SDK installation which prevents VS from using the newer SDK. Have a look here for further information.

As an alternative, you could simply disable DirectWrite, which isn’t really necessary.


[quote=“jrlanglois”]Try this download if you haven’t:

Thanks, but I’d already installed it.

[quote=“ckk”]Are you using the express edition?
If so, there is a bug in the SDK installation which prevents VS from using the newer SDK. Have a look here for further information.

As an alternative, you could simply disable DirectWrite, which isn’t really necessary.

I’m using the so-called Professional version, actually trying to build 32-bit. Nonetheless, that looks like a useful article to keep in the pocket. Thanks for the DirectWrite tip. I think I’m going to try this under XP and see if I can reduce the problem space.

Just to be sure, have you properly set up the search paths for the Visual C++ 2008 compiler?
Make sure the Windows SDK is the top of the list in both include and library search path lists.
Since the installer doesn’t do that on it’s own, you need to do that yourself.

What lucem just said. After the install you need to configure the Visual Studio include paths to point at those directories (this is how to get to it from VS2005, Tools/Options/Projects and Solutions/VC++ Directories).

I meant to get back to the people who offered help to me. It turned out that it was a registry issue (is there anything left to say about the registry?). For whatever reason, none of my installs and reinstalls saw fit to create a couple of HKEY_LOCAL_USER keys that were necessary. Once I created those keys, everything was hunky-dory.

Thanks again to those who took the time to offer their suggestions.

Here is the Microsoft bug report:

Changing the SDK value in the Windows SDK Configuration Tool worked for me.

I had this problem the other day too - I use XCode mostly now, and fancied testing a win build. It always used to work, but now didn’t!
A quick search showed that I already did have the right SDK installed, and the file it was looking for existed. I just added the SDK’s include folder to the VC++ directories and it worked fine.


Hey Friends…

I am encountered with same error and problem, but I am on windowXP(X86) and My visual studio is 2005, Any idea how this problem can be solved in such environment ?

Thanks friends…

In order to complete the last question and in order to prevent others from puzzling around I’ll write down my experiences with a basic Visual Studio 2005 installation.

  1. When I tried to compile a simple juce project I first got the error Cannot open include file: ‘d2d1.h’. That comes from the used platform SDK being to old. So I needed to go to where I downloaded the newest Windows SDK for Windows 7.

  2. Although being installed It was not possible to integrate the new SDK automatically. Neither by using the Windows SDK Configuration Tool nor by prompting WindowsSdkVer.exe -version:v7.0. So I customized the project properties and added the path …Microsoft SDKs\Windows\v7.0\Include to additional include directories and the path …Microsoft SDKs\Windows\v7.0\Lib to additional library directories.

  3. Now I got compiler errors like error C2733: second C linkage of overloaded function ‘_interlockedbittestandset’ not allowed. That comes from functions _interlockedbittestandset and _interlockedbittestandreset being defined in WinNT.h as well as intrin.h. So I customized the juce file juce\modules\juce_core\system\juce_StandardHeader.h and changed the section

#if JUCE_USE_INTRINSICS #include <intrin.h> #endif

#if JUCE_USE_INTRINSICS #define _interlockedbittestandset winnt_set #define _interlockedbittestandreset winnt_reset #include <intrin.h> #undef _interlockedbittestandset #undef _interlockedbittestandreset #endif

  1. After that everything compiled fine. But now I got linker errors like Fatal error LNK1103: debugging information corrupt. They’ve been caused by VS2005 which was unable to use *.lib or *.obj that were build under VS2008 or higher (as the library files of my new Windows SDK for Windows 7). So I downloaded and installed the patch from

And now everything compiled, linked and worked like a charm…