tags:

views:

21

answers:

3

Hi

I have a project that includes a device driver and the developer is able to compile it. I installed MS Visual C++ 2008 and the first error was "fatal error C1083: Cannot open include file: 'ntddk.h': No such file or directory". I downloaded the WDK from Microsoft website and installed it, I also executed Start -> All Programs -> Windows Driver Kits -> WDK 7600.16385.1 -> Build Environments -> Windows XP and "x86 Checked Build Environment" and "x86 Free Build Environment".

The problem persist, so I realized that I have to add by hand the paths, I don't know what to add, so I tried:

MS Visual C++ 2008 -> Tools -> Options -> Projects and Solutions -> VC++ Directories -> Include File and I added "C:\WinDDK\7600.16385.1\inc\ddk" and now I get:

c:\winddk\7600.16385.1\inc\ddk\wdm.h(54) : fatal error C1083: Cannot open include file: 'ntdef.h': No such file or directory

I did foundntdef.h under C:\WinDDK\7600.16385.1\inc\api and I added it too, but now I got a lot of errors and warnings. Since this project compile fine on the developer workstation I believe it's a problem on my configuration.

What is the right paths to add to MSVC++ 2008 to compile device drivers?

Thank you

A: 

There are shortcuts set up by the DDK installation that set this up correctly according to the type of build that you want. If you want to be able to do this manually, those shortcuts should be your source of information.

Brief quote:

When the WDK is installed, it defines the Start menu shortcuts for several different build environments. To open a build environment window, use the following Start menu path: Start | All Programs | Windows Driver Kits | WDK_Version | Build Environment | Operating System | Build Environment.

EDIT: When you run one of these shortcuts, you then have to run the Visual Studio 2008 IDE directly from the command prompt started by the shortcut, since the environment variable settings are not persisted by the shortcut. This should be done like so (using whatever path you have VS2008 set up in):

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>devenv

Steve Townsend
A: 

Hi

Thanks for your answer. I did it as I wrote on my first post, but nothing changed, I executed both "x86 Free Build Environment" and "x86 Checked Build Environment", both under Windows XP folder since my box has Windows XP and is a 32 bits system.

I don't want to do it manually, I prefer if it could be automatic, but it's not working.

When the installation finished I executed the bat script and restarted the box and opening MS VC++ 2008 and looking at libs and includes list and it's untouched.

Maybe I have to reinstall MS Visual C++ 2008 once I installed WDK? Or any idea why it's not working?

Thanks

@Steve you are right, it was my answer to your answer, sorry for confusion, I'm new at Stackoverflow.

I did it.

OACR monitor running already

C:\WinDDK\7600.16385.1>cd \

C:>cd "Program Files"

C:\Program Files>cd "Microsoft Visual Studio 9.0"

C:\Program Files\Microsoft Visual Studio 9.0>cd Common7

C:\Program Files\Microsoft Visual Studio 9.0\Common7>cd IDE

C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>VCExpress.exe

I called VCExpress.exe because it's the only EXE available on this directory.

However, the problem persist, very bad. If I go to path configuration on this new MS VC++ 2008 opened I see no new patches of variable imported. :(

Any other idea?

Thank you

Fred
@Fred - was this intended to be a comment on my answer? Sounds like it. See Edit of my original answer.
Steve Townsend
A: 

Just to test how the edit feature works. I answered on my previous post. Thanks

Fred