Cuda book examples error

There is a problem with running the cuda by example examples on cuda4 with vs2010

Where file includes windows headers directly it ends in an include trail which includes objbase.h and you get an error with Iunknown not found.

The solution is to put:
#ifdef _WIN32

Before any c/c++ includes in the .cu file
Or ideally of course don’t mix .cu and c/c++