阅读:2786回复:3
VC6.0 XPDDK 为什么自己动手就编译通不过呢?
根据张帆老师的Windows驱动开发技术详解里的例子,自己动手就出现大量的错误,环境设置也是按照他说的设置的,VC6.0 +XPDDK
错误如下: 请各位帮我看看,自己在网上搜索了相关的问题,有人说XPDDK不支持ds2.6,我对这方面也不是很懂,建议不要安装XPDDK,但我看到相关的DDK视频教程里用了XPDDK,也按照说明设置了环境,却出现这么多错误? 该怎么解决,急等......... 例题源代码在最下面链接中 --------------------Configuration: DriverDev - Win32 Driver Check Edtion-------------------- Compiling... Driver.cpp E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(350) : error C2146: syntax error : missing ';' before identifier 'Lock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(350) : error C2501: '_KDPC::PULONG_PTR' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(350) : error C2501: '_KDPC::Lock' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1784) : error C2146: syntax error : missing ';' before identifier 'KSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1784) : error C2501: 'KSPIN_LOCK' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1785) : error C2143: syntax error : missing ';' before '*' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1785) : error C2378: 'KSPIN_LOCK' : redefinition; symbol cannot be overloaded with a typedef E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1784) : see declaration of 'KSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1785) : error C2501: 'PKSPIN_LOCK' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1833) : error C2143: syntax error : missing ';' before 'volatile' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(1833) : error C2501: '_KSPIN_LOCK_QUEUE::PKSPIN_LOCK' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(6587) : error C2146: syntax error : missing ';' before identifier 'SetMember' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(6587) : error C2501: '_KPCR::KAFFINITY' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(6587) : error C2501: '_KPCR::SetMember' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(9866) : error C2146: syntax error : missing ';' before identifier 'Affinity' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(9866) : error C2501: '_CM_PARTIAL_RESOURCE_DESCRIPTOR::__unnamed::__unnamed::KAFFINITY' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(9866) : error C2501: '_CM_PARTIAL_RESOURCE_DESCRIPTOR::__unnamed::__unnamed::Affinity' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10006) : error C2146: syntax error : missing ';' before identifier 'AffinityMask' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10006) : error C2501: '_CM_COMPONENT_INFORMATION::KAFFINITY' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10006) : error C2501: '_CM_COMPONENT_INFORMATION::AffinityMask' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10747) : error C2146: syntax error : missing ';' before identifier 'Lock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10747) : error C2501: '_KDEVICE_QUEUE::KSPIN_LOCK' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(10747) : error C2501: '_KDEVICE_QUEUE::Lock' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2182: 'KeInitializeSpinLock' : illegal use of type 'void' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2491: 'KeInitializeSpinLock' : definition of dllimport data not allowed E:\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 E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11355) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2182: 'KefAcquireSpinLockAtDpcLevel' : illegal use of type 'void' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2491: 'KefAcquireSpinLockAtDpcLevel' : definition of dllimport data not allowed E:\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 E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11364) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2182: 'KefReleaseSpinLockFromDpcLevel' : illegal use of type 'void' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2491: 'KefReleaseSpinLockFromDpcLevel' : definition of dllimport data not allowed E:\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 E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11371) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11381) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11381) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11381) : error C2491: 'KfAcquireSpinLock' : definition of dllimport data not allowed E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11381) : error C2440: 'initializing' : cannot convert from 'int *' to 'KIRQL' This conversion requires a reinterpret_cast, a C-style cast or function-style cast E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11381) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11387) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11387) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11387) : error C2182: 'KfReleaseSpinLock' : illegal use of type 'void' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11387) : error C2491: 'KfReleaseSpinLock' : definition of dllimport data not allowed E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11387) : error C2440: 'initializing' : cannot convert from 'int *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11389) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11398) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11398) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11398) : error C2491: 'KeAcquireSpinLockRaiseToSynch' : definition of dllimport data not allowed E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11398) : error C2440: 'initializing' : cannot convert from 'int *' to 'KIRQL' This conversion requires a reinterpret_cast, a C-style cast or function-style cast E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11398) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11449) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11449) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11449) : error C2491: 'KeTryToAcquireSpinLockAtDpcLevel' : definition of dllimport data not allowed E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11449) : error C2440: 'initializing' : cannot convert from 'int *' to 'BOOLEAN' This conversion requires a reinterpret_cast, a C-style cast or function-style cast E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11449) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11561) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11561) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11561) : error C2182: 'KeAcquireInStackQueuedSpinLock' : illegal use of type 'void' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11561) : error C2491: 'KeAcquireInStackQueuedSpinLock' : definition of dllimport data not allowed E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11561) : error C2440: 'initializing' : cannot convert from 'int *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11563) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11582) : error C2146: syntax error : missing ')' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11582) : warning C4229: anachronism used : modifiers on data are ignored E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11582) : error C2182: 'KeAcquireInStackQueuedSpinLockAtDpcLevel' : illegal use of type 'void' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11582) : error C2491: 'KeAcquireInStackQueuedSpinLockAtDpcLevel' : definition of dllimport data not allowed E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11582) : error C2440: 'initializing' : cannot convert from 'int *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11584) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11691) : error C2146: syntax error : missing ';' before identifier 'KeQueryActiveProcessors' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(11691) : error C2501: 'KAFFINITY' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12025) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12035) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12062) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12071) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12079) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12087) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12096) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12420) : error C2146: syntax error : missing ';' before identifier 'Lock__ObsoleteButDoNotDelete' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12420) : error C2501: '_NPAGED_LOOKASIDE_LIST::KSPIN_LOCK' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12420) : error C2501: '_NPAGED_LOOKASIDE_LIST::Lock__ObsoleteButDoNotDelete' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(12811) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(13050) : error C2146: syntax error : missing ';' before identifier 'SpinLock' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(13050) : error C2501: '_ERESOURCE::KSPIN_LOCK' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(13050) : error C2501: '_ERESOURCE::SpinLock' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17113) : error C2061: syntax error : identifier 'PKSPIN_LOCK' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17433) : error C2065: 'PULONG_PTR' : undeclared identifier E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17433) : error C2146: syntax error : missing ')' before identifier 'LowLimit' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17433) : error C2182: 'IoGetStackLimits' : illegal use of type 'void' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17433) : error C2491: 'IoGetStackLimits' : definition of dllimport data not allowed E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17435) : error C2059: syntax error : ')' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17450) : error C2064: term does not evaluate to a function E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17979) : error C2146: syntax error : missing ';' before identifier 'Spin' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17979) : error C2501: '_IO_REMOVE_LOCK_DBG_BLOCK::KSPIN_LOCK' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(17979) : error C2501: '_IO_REMOVE_LOCK_DBG_BLOCK::Spin' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(19384) : error C2146: syntax error : missing ';' before identifier 'WorkSpace' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(19384) : error C2501: '_ARBITER_LIST_ENTRY::LONG_PTR' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(19384) : error C2501: '_ARBITER_LIST_ENTRY::WorkSpace' : missing storage-class or type specifiers E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(19702) : error C2061: syntax error : identifier 'PKAFFINITY' E:\WINDDK\2600\inc\ddk\wxp\ntddk.h(20112) : error C2061: syntax error : identifier 'PULONG_PTR' Error executing cl.exe. HelloDDK.sys - 95 error(s), 9 warning(s) |
|
|
沙发#
发布于:2009-03-10 15:34
帮你顶顶,我昨天终于用VC6编译成功了我的第一个驱动,前后看的文章可不少呀。呵呵~~~
|
|
板凳#
发布于:2009-03-10 17:57
看来你也是刚刚接触这些啊,以后可以就相关问题进行探讨一下,呵呵
|
|
地板#
发布于:2009-03-17 14:42
楼上各位仁兄,xpddk需要建什么样的工程啊?搞了好久也没搞清楚,给小弟指条明路吧
|
|