| 
					阅读:2139回复:11
				 关于.C 和.cpp的问题
					我在写硬盘驱动时,调用IoGetConfigurationInformation() 在将其放在.c 结尾的文件时连接能通过,但将其放在 .cpp 为结尾的文件时连接通不过,何因				 | |
| 沙发#发布于:2002-06-02 11:32 
					大家能不能帮帮忙,我该怎么办				 | |
| 板凳#发布于:2002-05-30 18:42 
					这个函数在2000ddk的头文件中有定义,编译也能通的过,就是连接时找不到该函数,可用c完全正常,难道没有办法了吗,我是个初学者,所看的教材是用c++搭了一个平台,因此只能用.cpp进行编泽,我不知用c如何对驱动程序进行连接,进行测试				 | |
| 地板#发布于:2002-05-30 08:49 
					IoGetConfigurationInformation在98ddk中根本没有说明, MSDN中说明的原型是PCONFIGURATION_INFORMATION 
 IoGetConfigurationInformation(); 但连PCONFIGURATION_INFORMATION在DDK和VC中都无定义。 我想是因为这个函数不在DDK库中。 | |
| 
 | 
| 地下室#发布于:2002-05-29 23:23 
					tigerzd: 用你提供的方法好像也不行,其提示如下
 Config.cpp(19) : error C2732: linkage specification contradicts earlier specification for \'IoGetConfigurationInformation\' F:\\520work\\Minimal\\Config.cpp(19) : see declaration of \'IoGetConfigurationInformation\' 不知何因,其主要是连接时找不到库,我看了MSDN文档,但里面没有注明在哪个库中 | |
| 5楼#发布于:2002-05-29 20:12 用户被禁言,该主题自动屏蔽! | |
| 6楼#发布于:2002-05-29 10:23 黑黑。。。。。。。。。。 抛砖引玉。。。抛砖引玉。。。 | |
| 
 | 
| 7楼#发布于:2002-05-29 08:52 
					这个问题我遇到过。
 当以.cpp为后最时,不能使用extern \"c\" 声明。 去掉extern \"c\"就可以了。 | |
| 
 | 
| 8楼#发布于:2002-05-29 08:35 
					cpp为后缀是,将函数如此包装:
 #ifdef __cplusplus extern \"C\" { #endif #include \"wdm.h\" #ifdef __cplusplus } #endif extern \"C\" { XXX IoGetConfigurationInformation(XXX) } | |
| 
 | 
| 9楼#发布于:2002-05-28 23:18 
					是这个提示
 Config.obj : error LNK2001: unresolved external symbol \"__declspec(dllimport) struct _CONFIGURATION_INFORMATION * __stdcall IoGetConfigurationInformation(void)\" (__imp_?IoGetConfigurationInformation@@YGPAU_CONFIGURATION_INFORMATION@@XZ) | |
| 10楼#发布于:2002-05-28 23:08 
					我用了是VC6。0  提示是 
 error LNK2001: unresolved external symbol \"__declspec(dllimport) unsigned char __stdcall IoGetConfigurationInformation (enum _INTERFACE_TYPE,unsigned long,union _LARGE_INTEGER,unsigned long *,union _LARGE_INTEGER *)\" (__imp_?HalTranslateBusAddr | |
| 11楼#发布于:2002-05-28 22:32 可能的原因太多了。。。。。。。。。 可否,详实点。。。。。。。。。。。。。。 你的编译器? 编译后的提示。。。。。。。。。。。。。 | |
| 
 | 
 
							
 
				 
				
