阅读:1770回复:9
我用2Kddk编写的驱动,在2K下编译很正常!!但是在XP下!!请大侠帮助呀!!
我在编译的时候(使用build指令)却提示:
e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2005) : error C2061: syntax error : identifier 'InitializeListHead' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2005) : error C2059: syntax error : ';' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2006) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2026) : error C2061: syntax error : identifier 'RemoveEntryList' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2026) : error C2059: syntax error : ';' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2027) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2041) : error C2061: syntax error : identifier 'RemoveHeadList' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2041) : error C2059: syntax error : ';' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2042) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2059) : error C2061: syntax error : identifier 'RemoveTailList' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2059) : error C2059: syntax error : ';' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2060) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2076) : error C2061: syntax error : identifier 'InsertTailList' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2076) : error C2059: syntax error : ';' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2077) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2093) : error C2061: syntax error : identifier 'InsertHeadList' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2093) : error C2059: syntax error : ';' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2094) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2898) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2903) : error C2085: 'RtlLargeIntegerAdd' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2903) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2917) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2922) : error C2085: 'RtlEnlargedIntegerMultiply' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2922) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2936) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2941) : error C2085: 'RtlEnlargedUnsignedMultiply' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2941) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2955) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2961) : error C2085: 'RtlEnlargedUnsignedDivide' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2961) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2979) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2983) : error C2085: 'RtlLargeIntegerNegate' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2983) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(2997) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3002) : error C2085: 'RtlLargeIntegerSubtract' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3002) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3041) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3046) : error C2085: 'RtlExtendedMagicDivide' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3127) : error C2061: syntax error : identifier 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3145) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3150) : error C2085: 'RtlLargeIntegerDivide' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3157) : error C2061: syntax error : identifier 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3185) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3189) : error C2085: 'RtlConvertLongToLargeInteger' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3189) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3203) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3207) : error C2085: 'RtlConvertUlongToLargeInteger' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3207) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3221) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3226) : error C2085: 'RtlLargeIntegerShiftLeft' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3226) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3236) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3241) : error C2085: 'RtlLargeIntegerShiftRight' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3241) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3251) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3256) : error C2085: 'RtlLargeIntegerArithmeticShift' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3256) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3954) : error C2054: expected '(' to follow 'FORCEINLINE' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3958) : error C2085: 'RtlConvertLongToLuid' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3958) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3970) : error C2054: expected '(' to follow 'FORCEINLINE' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3974) : error C2085: 'RtlConvertUlongToLuid' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(3974) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(6587) : error C2061: syntax error : identifier 'KAFFINITY' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(6593) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(7096) : error C2054: expected '(' to follow 'FORCEINLINE' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(7098) : error C2085: 'KeGetCurrentProcessorNumber' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(7098) : error C2143: syntax error : missing ';' before '{' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9866) : error C2061: syntax error : identifier 'KAFFINITY' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9867) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9921) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9922) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9940) : error C2061: syntax error : identifier 'CM_PARTIAL_RESOURCE_DESCRIPTOR' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9941) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9963) : error C2061: syntax error : identifier 'CM_PARTIAL_RESOURCE_LIST' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9964) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9973) : error C2061: syntax error : identifier 'CM_FULL_RESOURCE_DESCRIPTOR' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(9974) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(10006) : error C2061: syntax error : identifier 'KAFFINITY' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(10007) : error C2059: syntax error : '}' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(11691) : error C2061: syntax error : identifier 'KeQueryActiveProcessors' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(11691) : error C2059: syntax error : ';' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(11693) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12756) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12759) : error C2085: 'ExQueueWorkItem' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12766) : error C2085: 'ExIsProcessorFeaturePresent' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12775) : error C2085: 'ZONE_SEGMENT_HEADER' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12775) : error C2085: 'PZONE_SEGMENT_HEADER' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12782) : error C2085: 'ZONE_HEADER' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12782) : error C2085: 'PZONE_HEADER' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12785) : error C2061: syntax error : identifier 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12798) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12799) : error C2146: syntax error : missing ')' before identifier 'Zone' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12799) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12799) : error C2144: syntax error : '<Unknown>' should be preceded by '<Unknown>' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12799) : error C2143: syntax error : missing ')' before 'identifier' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12799) : error C2085: 'ExExtendZone' : not in formal parameter list e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12799) : error C2146: syntax error : missing ',' before identifier 'Zone' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12800) : error C2059: syntax error : 'type' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12802) : error C2059: syntax error : ')' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12807) : error C2054: expected '(' to follow 'DECLSPEC_DEPRECATED_DDK' e:\winddk_xp\2600\inc\ddk\wxp\ntddk.h(12807) : error C1003: error count exceeds 100; stopping compilation NMAKE : U1073: don't know how to make 'objchk\i386\*.sbr' 我看好像是我加载的头文件出来错误,请问那位大侠能帮我吗?? 我加载的头文件是: #include "ntddk.h" #include "string.h" //2004-7-17添加 #include "bugcodes.h" #include "ntstatus.h" #include <stdio.h> 在2K下编译没有问题!! |
|
沙发#
发布于:2004-09-09 22:52
我试着编译了一下XPDDK下带的例子,都可以编译过去,奇怪我写的为什么不可以编译过去呢???
|
|
板凳#
发布于:2004-09-10 08:40
你看一看出错位置:如
e:winddk_xp2600incddkwxpntddk.h(2005) : error C2061: syntax error : identifier 'InitializeListHead 估计是InitializeListHead结构定义不识别,需要他它的结构定义头文件包含在他前面,就行了 |
|
|
地板#
发布于:2004-09-10 08:49
估计是哪个头文件的位置不对.....
|
|
|
地下室#
发布于:2004-09-10 10:35
ft,写了一堆,结果说错误,全没了。
应该是FORCEINLINE不认识,你试一下自己声明 #ifndef FORCEINLINE #if (_MSC_VER >= 1200) #define FORCEINLINE __forceinline #else #define FORCEINLINE __inline #endif #endif 原因我觉得还是你使用方法的问题。 |
|
5楼#
发布于:2004-09-10 17:55
如果用到ntddk.h中定义的函数或结构,
建议将其拷贝到自己的头文件, 因为ntddk.h的依赖性很强,其内部定义需要好几个头文件支持, 有时包含了还会和VC的头文件冲突,产生重复定义和声明 |
|
|
6楼#
发布于:2004-09-10 21:40
arthurtu:
我照着你的方法试了,不行的!!依然报错! |
|
7楼#
发布于:2004-09-10 21:43
snowStart
你说的,我觉得要讲所有用到的函数(DDK)的全自己在头文件中定义一边,比较麻烦!!如果我安装了IFS可以吗? 或者我讲2K的ntddk文件拷贝到XP下这样可以吗??? |
|
8楼#
发布于:2004-09-12 14:32
我不知道你都用了那些函数,如果想要包含ntddk,那你就在它的前面把包含相关定义的头文件都找到,把包含到他的前面:
如: #include <head1.h> ... #include <headn.h> #inclkude <Ntddk.h> |
|
|
9楼#
发布于:2004-09-14 00:15
我看到了一个文章好像说是DDK的一个BUG。说使用IFS可以,我安装了IFS_XP SP1可是怎么使用IFS编译我的程序呢?我使用build提示说没有这个命令???这是为什么呢??
|
|