阅读:1703回复:5
大侠,救命!
各位大侠,小弟正在做毕业设计,照着书上的例子敲了一个驱动程序,在编译的时候出了一个很奇怪的问题,就是编译都通过了而且都生成了OBJ文件,但是连接出了问题就是无法连接生成SYS文件,期望能获得大侠的指教:
init.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall RtlCopyUnicodeString(struct _UNICODE_STRING *,struct _UNICODE_STRING *)\" (__imp_?RtlCopyUnicodeString@@YGXPAU_UNICODE_STRING@@0@Z) init.obj() : error LNK2001: unresolved external symbol \"struct _UNICODE_STRING servkey\" (?servkey@@3U_UNICODE_STRING@@A) wmi.obj() : error LNK2001: unresolved external symbol \"struct _UNICODE_STRING servkey\" (?servkey@@3U_UNICODE_STRING@@A) init.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void * __stdcall ExAllocatePoolWithTag(enum _POOL_TYPE,unsigned long,unsigned long)\" (__imp_?ExAllocatePoolWithTag@@YGPAXW4_POOL_TYPE@@KK@Z) init.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall ExFreePool(void *)\" (__imp_?ExFreePool@@YGXPAX@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) struct _DEVICE_OBJECT * __stdcall IoAttachDeviceToDeviceStack(struct _DEVICE_OBJECT *,struct _DEVICE_OBJECT *)\" (__imp_?IoAttachDeviceToDeviceStack@@YGPAU_DEVICE_OBJECT@@PAU1@0@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoSetDeviceInterfaceState(struct _UNICODE_STRING *,unsigned char)\" (__imp_?IoSetDeviceInterfaceState@@YGJPAU_UNICODE_STRING@@E@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall IoDeleteDevice(struct _DEVICE_OBJECT *)\" (__imp_?IoDeleteDevice@@YGXPAU_DEVICE_OBJECT@@@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoRegisterDeviceInterface(struct _DEVICE_OBJECT *,struct _GUID const *,struct _UNICODE_STRING *,struct _UNICODE_STRING *)\" (__imp_?IoRegisterDeviceInterface@@YGJPAU_DEVICE_OBJECT@@PBU_GUID@@PAU_UNICODE_STRING@@2@Z) pnp.obj() : error LNK2001: unresolved external symbol _WDM_GUID pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoCreateDevice(struct _DRIVER_OBJECT *,unsigned long,struct _UNICODE_STRING *,unsigned long,unsigned long,unsigned char,struct _DEVICE_OBJECT * *)\" (__imp_?IoCreateDevice@@YGJPAU_DRIVER_OBJECT@@KPAU_UNICODE_STRING@@KKEPAPAU_DEVICE_OBJECT@@@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall IoDetachDevice(struct _DEVICE_OBJECT *)\" (__imp_?IoDetachDevice@@YGXPAU_DEVICE_OBJECT@@@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall RtlFreeUnicodeString(struct _UNICODE_STRING *)\" (__imp_?RtlFreeUnicodeString@@YGXPAU_UNICODE_STRING@@@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __fastcall IofCallDriver(struct _DEVICE_OBJECT *,struct _IRP *)\" (__imp_?IofCallDriver@@YIJPAU_DEVICE_OBJECT@@PAU_IRP@@@Z) wmi.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __fastcall IofCallDriver(struct _DEVICE_OBJECT *,struct _IRP *)\" (__imp_?IofCallDriver@@YIJPAU_DEVICE_OBJECT@@PAU_IRP@@@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall PoCallDriver(struct _DEVICE_OBJECT *,struct _IRP *)\" (__imp_?PoCallDriver@@YGJPAU_DEVICE_OBJECT@@PAU_IRP@@@Z) pnp.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __stdcall PoStartNextPowerIrp(struct _IRP *)\" (__imp_?PoStartNextPowerIrp@@YGXPAU_IRP@@@Z) wmi.obj() : error LNK2001: unresolved external symbol _WMI_GUID wmi.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) long __stdcall IoWMIRegistrationControl(struct _DEVICE_OBJECT *,unsigned long)\" (__imp_?IoWMIRegistrationControl@@YGJPAU_DEVICE_OBJECT@@K@Z) wmi.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __fastcall IofCompleteRequest(struct _IRP *,char)\" (__imp_?IofCompleteRequest@@YIXPAU_IRP@@D@Z) dispatch.obj() : error LNK2001: unresolved external symbol \"__declspec(dllimport) void __fastcall IofCompleteRequest(struct _IRP *,char)\" (__imp_?IofCompleteRequest@@YIXPAU_IRP@@D@Z) wmi.obj() : error LNK2001: unresolved external symbol _WmiSystemControl@16 wmi.obj() : error LNK2001: unresolved external symbol _WmiCompleteRequest@20 完整的代码在附件内: |
|
|
沙发#
发布于:2005-04-14 21:05
给你改好了。。自己对照看看修改的地方吧,,没有写文档哦。。。
|
|
|
板凳#
发布于:2005-04-14 21:37
借来一看。 :D
多亏有老大这样的热心人,我们这些菜鸟才得以生存啊。 再次谢谢老大们。 |
|
|
地板#
发布于:2005-04-14 21:39
借来一看。 :D
多亏有老大这样的热心人,我们这些菜鸟才得以生存啊。 再次谢谢老大们。 to:yeanwu 我也在做驱动,刚刚学习,以后一起研究。 :) |
|
|
地下室#
发布于:2005-04-15 15:53
非常感谢aiwadgj大佬,问题得以解决,小弟无以为报,再问一句给分如何给?
TO:Raul_Shao 同是天涯沦落人,我的E-MAIL是:yeanwu@163.com,我们可以一起探讨一下。 |
|
5楼#
发布于:2005-04-15 22:25
非常感谢aiwadgj大佬,问题得以解决,小弟无以为报,再问一句给分如何给? 你开的第一帖子下不是有很多按钮吗。。。“引用”。。“改分”之类的。。 点那个“给分”按钮就可以了。。。 大家互相学习了。。。。不要客气的。。。呵呵。。 |
|
|