2

I am getting this error when I am trying to build my driver:

Driver.cpp(7): fatal error C1083: Cannot open include file: 'ntddk.h': No such file or directory

I am using Visual Studio 2012 with WDK 8.1 installed (I have not cinfigured anything in VS).

Any help is appreciated.

Collage_Guy
  • 21
  • 1
  • 1
  • 3

3 Answers3

3

Go to project properties -> C/C++ -> General, and add ddk headers path to Additional Include Directories tab. It should be sth like $(WDKPATH)\inc\ddk where $(WDKPATH) is ofc a directory where You have installed WDK.

ladan
  • 423
  • 4
  • 10
2

You need Visual Studio 2013 for WDK 8.1

Quote :

Important: Before installing WDK 8.1 Update, you need to install Visual Studio 2013. See the Visual Studio links on this page.

Muhamed Krlić
  • 1,462
  • 2
  • 16
  • 25
0

I am using Visual Studio 2017 and I had the same issue when trying to compile a driver.

This solution help me:
You need to add WDK headers path to your vcxproj include directories:
vcxproj properties -> C/C++ -> General -> Additional Include Directories

C:\Program Files (x86)\Windows Kits\10\Include\10.0.14393.0\km\
E235
  • 11,560
  • 24
  • 91
  • 141