Gents,
I’ve a vanilla install of VS 2012 on a vanilla install of Win7.
I’ve installed WDK 8.0, created a project which is “Empty Static Library for Drivers”, created a single C file which is this;
#include <wdf.h>
and hit compile.
The build fails with 1083, cannot open include file.
A recursive directory listing finds the file in a couple of places (different versions);
C:>dir wdf.h /s /b
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.11\wdf.h
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.5\wdf.h
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.7\wdf.h
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.9\wdf.h
Checking solution configuration, I see this;
VC++ Directories -> Include Directories = $(ProjectDir);$(IncludePath)
$(ProjectDir) I believe to be the dir where the solution file is found.
$(IncludePath) I believe is the value of %INCLUDE%, which is my normal environment is not set.
As such, I understand in a technical sense why the file is not found - but I do not understand in a larger sense. I have installed WDK, I expect it to work. It does not. Have I messed it up, or is it really like this? do I need to manually fix up the paths? if so, does anything else need fixing up?
I also note _KERNEL_MODE is not set; so I think I can’t know I’m compiling for the kernel, which seems to me to be essential information - I cannot comprehend its genuine absence. I understand /kernel has to be given for this macro to be set, so I seem to need to add this.
I downloaded the WDK examples and I’ve been looking at one of these, “KMDF Echo Sample”.
Examining the paths in this solution, the only difference is in the Library Directories, which in my project is;
$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);
and in the sample is;
$(WDKContentRoot)lib$(DDKSpec)\KM$(DDKPlatform);$(LibraryPath)
So here I can see why linking works.
However, it is not obvious how header file searching works. What I do note, digging around some more, is that in one of the projects in this solution, in “Additional Include Directories”, the string “$(DDK_INC_PATH)” has been added.
However, this is not set in the environment, and anyways I think is an old variable, from 7.1 and earlier, no longer used?
So, all in all, I’m confused as all hell. I can’t find explanations on-line, my expectations that things should work after an install are not met, but in bizzare and puzzling ways - I can’t even see why things which do work, work.
Any guidance and/or explanation gratefully received. What is supposed to be going on here?</wdf.h>
You may have better luck building a kmdf library if you make an empty kmdf driver project, delete the package project and the INF file and then change the target type from driver to static library. That template will set up the kmdf version and paths appropriately
-p
Sent from my Windows Phone
From: xxxxx@winterflaw.netmailto:xxxxx
Sent: ?1/?10/?2015 1:29 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Confusion/Problems installing WDK 8.0 with VC 2012 - include paths wrong?
Gents,
I’ve a vanilla install of VS 2012 on a vanilla install of Win7.
I’ve installed WDK 8.0, created a project which is “Empty Static Library for Drivers”, created a single C file which is this;
#include <wdf.h>
and hit compile.
The build fails with 1083, cannot open include file.
A recursive directory listing finds the file in a couple of places (different versions);
C:>dir wdf.h /s /b
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.11\wdf.h
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.5\wdf.h
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.7\wdf.h
C:\Program Files (x86)\Windows Kits\8.0\Include\wdf\kmdf\1.9\wdf.h
Checking solution configuration, I see this;
VC++ Directories -> Include Directories = $(ProjectDir);$(IncludePath)
$(ProjectDir) I believe to be the dir where the solution file is found.
$(IncludePath) I believe is the value of %INCLUDE%, which is my normal environment is not set.
As such, I understand in a technical sense why the file is not found - but I do not understand in a larger sense. I have installed WDK, I expect it to work. It does not. Have I messed it up, or is it really like this? do I need to manually fix up the paths? if so, does anything else need fixing up?
I also note _KERNEL_MODE is not set; so I think I can’t know I’m compiling for the kernel, which seems to me to be essential information - I cannot comprehend its genuine absence. I understand /kernel has to be given for this macro to be set, so I seem to need to add this.
I downloaded the WDK examples and I’ve been looking at one of these, “KMDF Echo Sample”.
Examining the paths in this solution, the only difference is in the Library Directories, which in my project is;
$(VCInstallDir)lib;$(VCInstallDir)atlmfc\lib;$(WindowsSDK_LibraryPath_x86);
and in the sample is;
$(WDKContentRoot)lib$(DDKSpec)\KM$(DDKPlatform);$(LibraryPath)
So here I can see why linking works.
However, it is not obvious how header file searching works. What I do note, digging around some more, is that in one of the projects in this solution, in “Additional Include Directories”, the string “$(DDK_INC_PATH)” has been added.
However, this is not set in the environment, and anyways I think is an old variable, from 7.1 and earlier, no longer used?
So, all in all, I’m confused as all hell. I can’t find explanations on-line, my expectations that things should work after an install are not met, but in bizzare and puzzling ways - I can’t even see why things which do work, work.
Any guidance and/or explanation gratefully received. What is supposed to be going on here?
—
NTDEV is sponsored by OSR
Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
OSR is HIRING!! See http://www.osr.com/careers
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</wdf.h></mailto:xxxxx></mailto:xxxxx>