如果编译驱动的时候发现都没有什么地方错误,但是就是编译不过去 ,就看看源码有没有CPP格式的 改成.C也许就能通过WDK的编译了.
用WDK编译驱动出现了 很多错误 如下,不知道怎么回事,于是转到VS环境编译 就又出现第二个方块的情况,于是百度百度,,,,,
看到一个帖子说 是因为后缀为CPP的源码 在引用头文件的时候不规范 ,于是改...
1>errors in directory e:\kugou\by1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(2156) : error C2220: warning treated as error - no object file generated1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(2156) : error C4162: '_ReturnAddress' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6902) : error C4162: '_InterlockedExchange' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6928) : error C4162: '_InterlockedIncrement' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6941) : error C4162: '_InterlockedDecrement' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6955) : error C4162: '_InterlockedExchangeAdd' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6985) : error C4162: '_InterlockedCompareExchange' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7037) : error C4162: '_InterlockedOr' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7047) : error C4162: '_InterlockedAnd' : no function with C linkage found1>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7057) : error C4162: '_InterlockedXor' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(2156) : error C2220: warning treated as error - no object file generated100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(2156) : error C4162: '_ReturnAddress' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6902) : error C4162: '_InterlockedExchange' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6928) : error C4162: '_InterlockedIncrement' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6941) : error C4162: '_InterlockedDecrement' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6955) : error C4162: '_InterlockedExchangeAdd' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(6985) : error C4162: '_InterlockedCompareExchange' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7037) : error C4162: '_InterlockedOr' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7047) : error C4162: '_InterlockedAnd' : no function with C linkage found100>e:\winddk\3790.1830\inc\ddk\wxp\ntddk.h(7057) : error C4162: '_InterlockedXor' : no function with C linkage found
1>正在编译...1>cl : Command line warning D4002 : ignoring unknown option '/errorReport:prompt'1>cl : Command line warning D4024 : unrecognized source file type '?', object file assumed1>LINK : fatal error LNK1104: cannot open file ''
CPP源文件引用头文件 格式如下:
extern "C"{#include}