阅读:4958回复:14
求救:NTDDK.h编译错误。。。。。。!!!!
各位大虾,小弟刚装完WINDOWS2K的DDK,用VC++6.0编译 Art Baker & Jerry Lozano的《WINDOWS2000 Device Driver Book》第六章的Minimal程序时,VC报错说NTDDK.h有多处错误!!!!!!不知是怎么回事。。。。。。求大虾们救救小弟啊。。。。。。。。
|
|
沙发#
发布于:2002-08-07 08:29
是什么错误?
|
|
|
板凳#
发布于:2002-08-07 08:31
一定不是DDK的错误
|
|
|
地板#
发布于:2002-08-07 09:18
用了模板吗?否则系统配置有问题
|
|
地下室#
发布于:2002-08-07 10:16
你连报的什么错误都不说,怎么解决?
|
|
5楼#
发布于:2002-08-07 10:53
错误如下:
E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(370) : error C2146: syntax error : missing \';\' before identifier \'Lock\' E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(370) : error C2501: \'PULONG_PTR\' : missing storage-class or type specifiers E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(370) : error C2501: \'Lock\' : missing storage-class or type specifiers E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(824) : error C2146: syntax error : missing \';\' before identifier \'KSPIN_LOCK\' E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(824) : fatal error C1004: unexpected end of file found Unicode.cpp E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(370) : error C2146: syntax error : missing \';\' before identifier \'Lock\' E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(370) : error C2501: \'PULONG_PTR\' : missing storage-class or type specifiers E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(370) : error C2501: \'Lock\' : missing storage-class or type specifiers E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(824) : error C2146: syntax error : missing \';\' before identifier \'KSPIN_LOCK\' E:\\EEPROGRAM\\NTDDK\\INC\\DDK\\NTDDK.h(824) : fatal error C1004: unexpected end of file found Error executing cl.exe. |
|
6楼#
发布于:2002-08-07 12:27
大概是你的Project中的Settings不对,在C/C++中的Category:选Preprocessor,再在Addtional Include Directory:$(BASEDIR)\\inc\\ddk\\wdm,$(BASEDIR)\\inc\\ddk,$(BASEDIR)\\inc,$(BASEDIR)\\inc\\win98,$(DRIVERWORKS)\\include,.,$(DRIVERWORKS)\\source,\\inc
试试看 |
|
|
7楼#
发布于:2002-08-07 12:41
应该是编译环境没设置好。
|
|
|
8楼#
发布于:2002-08-07 12:42
我想有可能是起先没有编译库文件的缘故吧!
|
|
9楼#
发布于:2002-08-07 13:05
多谢各位。。。。。。。。。搞定。。。。。。。。。。 :D
|
|
10楼#
发布于:2002-08-08 18:14
请问你是怎么搞定的,我也式过那个程序,在VC下只能编译,不能BUILD,为什么呢?如果在VC下BUILD 的话,就提示关于<NTDDK>的错误.
|
|
11楼#
发布于:2002-08-09 00:12
网站的专栏文章里有详细的方法。。。。俺就是看了那才搞定的。。。。建议老兄也去看看。。。。。。呵呵。。。。
我们共同进步。。。。。。。。。 |
|
12楼#
发布于:2002-08-11 12:40
好的,谢谢
|
|
13楼#
发布于:2009-11-25 17:10
大哥把那个专栏文章的名字告诉欧文啊。谢谢!!!
|
|
14楼#
发布于:2009-11-25 17:15
D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(350) : error C2146: syntax error : missing ';' before identifier 'Lock'
D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(350) : error C2501: '_KDPC::PULONG_PTR' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(350) : error C2501: '_KDPC::Lock' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1784) : error C2146: syntax error : missing ';' before identifier 'KSPIN_LOCK' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1784) : error C2501: 'KSPIN_LOCK' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1785) : error C2143: syntax error : missing ';' before '*' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1785) : error C2378: 'KSPIN_LOCK' : redefinition; symbol cannot be overloaded with a typedef D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1784) : see declaration of 'KSPIN_LOCK' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1785) : error C2501: 'PKSPIN_LOCK' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1833) : error C2143: syntax error : missing ';' before 'volatile' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1833) : error C2501: '_KSPIN_LOCK_QUEUE::PKSPIN_LOCK' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(6587) : error C2146: syntax error : missing ';' before identifier 'SetMember' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(6587) : error C2501: '_KPCR::KAFFINITY' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(6587) : error C2501: '_KPCR::SetMember' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(9866) : error C2146: syntax error : missing ';' before identifier 'Affinity' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(9866) : error C2501: '_CM_PARTIAL_RESOURCE_DESCRIPTOR::__unnamed::__unnamed::KAFFINITY' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(9866) : error C2501: '_CM_PARTIAL_RESOURCE_DESCRIPTOR::__unnamed::__unnamed::Affinity' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10006) : error C2146: syntax error : missing ';' before identifier 'AffinityMask' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10006) : error C2501: '_CM_COMPONENT_INFORMATION::KAFFINITY' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10006) : error C2501: '_CM_COMPONENT_INFORMATION::AffinityMask' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10747) : error C2146: syntax error : missing ';' before identifier 'Lock' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10747) : error C2501: '_KDEVICE_QUEUE::KSPIN_LOCK' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10747) : error C2501: '_KDEVICE_QUEUE::Lock' : missing storage-class or type specifiers D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2146: syntax error : missing ')' before identifier 'SpinLock' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : warning C4229: anachronism used : modifiers on data are ignored D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2182: 'KeInitializeSpinLock' : illegal use of type 'void' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2491: 'KeInitializeSpinLock' : definition of dllimport data not allowed D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2440: 'initializing' : cannot convert from 'int *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2059: syntax error : ')' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2146: syntax error : missing ')' before identifier 'SpinLock' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : warning C4229: anachronism used : modifiers on data are ignored D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2182: 'KefAcquireSpinLockAtDpcLevel' : illegal use of type 'void' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2491: 'KefAcquireSpinLockAtDpcLevel' : definition of dllimport data not allowed D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2440: 'initializing' : cannot convert from 'int *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2059: syntax error : ')' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2146: syntax error : missing ')' before identifier 'SpinLock' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : warning C4229: anachronism used : modifiers on data are ignored D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2182: 'KefReleaseSpinLockFromDpcLevel' : illegal use of type 'void' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2491: 'KefReleaseSpinLockFromDpcLevel' : definition of dllimport data not allowed D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2440: 'initializing' : cannot convert from 'int *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2059: syntax error : ')' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11381) : error C2146: syntax error : missing ')' before identifier 'SpinLock' D:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11381) : warning C4229: anachronism used : modifiers on data are ignored |
|