问题描述
嗨
这些天,我正在写驱动程序.我已经下载了WDK版本7.1.0
从Microsoft下载中心下载,在我的源代码中,我包含ndis.h
,但是在编译时,这些消息已显示:
------ Build started: Project: sys_test, Configuration: Debug Win32 ------ Compiling... source.cpp e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier
为什么说未声明"PAGE_SHIFT"和"PAGE_SIZE"?是否需要包含另一个头文件?
谢谢
------------------------------------
我做了您说的解决方案,但是这次编译器无法检测到我的CPU体系结构.我得到这些:
ClCompile: source.cpp d:\winddk\7600.16385.1\inc\ddk\wdm.h(14198): fatal error C1189: #error : "No target architecture defined" Build FAILED.
但是我知道我的CPU体系结构是x86.缺少的环境变量,通常由其他文件设置:
http://mcdermottcybersecurity.com/articles/64-bit-device-driver-development [ ^ ]
Hi
These days I''m working on writing driver. I''ve downloaded WDK version 7.1.0
from Microsoft download center and in my source code I include ndis.h
but when I compile it these messages have been shown:
------ Build started: Project: sys_test, Configuration: Debug Win32 ------ Compiling... source.cpp e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SIZE'' : undeclared identifier e:\wdk\ndis.h(2531) : error C2065: ''PAGE_SHIFT'' : undeclared identifier
Why does it say ''PAGE_SHIFT'' and ''PAGE_SIZE'' are undeclared? Is it necessary to include another header files?
Thanks
------------------------------------
I did the solution you said but this time the compiler couldn''t detect my CPU architecture. I got these:
ClCompile: source.cpp d:\winddk\7600.16385.1\inc\ddk\wdm.h(14198): fatal error C1189: #error : "No target architecture defined" Build FAILED.
But I know that my CPU architecture is x86.
这篇关于WDK错误(包括ndis.h)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!