阅读:1098回复:3
仔细看看,随便说说
98环境下,用vc6和ntddk开发98环境下usb驱动程序。按照书上所讲修改了vc6工程以及编译选项。编写了MakeDrvr批处理文件,来进行环境变量的设置工作,一切OK后,按f7编译,正常进行语法检查。但是在此过程中,发现vc调试窗中显示一个文件被编译。(我的sources文件中列出了5个文件)。另外,每次编译结束,退出vc后,windows无法正常关机,显示有一个程序正在运行(比如 link,nmake ..etc依赖vc编译所达到的状态)
错误代码: --------------------Configuration: sigusb - Win32 Debug-------------------- New or updated MSVC detected. Updating DDK environment.... Setting environment for using Microsoft Visual C++ tools. Bad command or file name Too many parameters Starting dirs creation...Completed. DOSKey installed BUILD: Object root set to: ==> objchk BUILD: /i switch ignored BUILD: Compile and Link for i386 BUILD: Loading e:\\ntddk\\build.dat... BUILD: Computing Include file dependencies: BUILD: Examining e:\\zhang\\mydriver\\driver3\\sigusb directory for files to compile. e:\\zhang\\mydriver\\driver3\\sigusb e:\\zhang\\mydriver\\driver3\\sigusb - 1 source files (440 lines) BUILD: Compiling e:\\zhang\\mydriver\\driver3\\sigusb directory Compiling - pnp.cpp for i386 sigusb.h(36) : error C2011: \'_SigUsb_DEVICE_EXTENSION\' : \'struct\' type redefinition绝对只定义了一次,,有点像把一个文件编译两边, 本人猜测 Linking Executable - objchk\\i386\\sigusb.sys for i386 link() : error LNK1181: cannot open input file \"objchk\\i386\\pnp.obj\" BUILD: Linking e:\\zhang\\mydriver\\driver3\\sigusb directory Compiling - pnp.cpp for i386 sigusb.h(36) : error C2011: \'_SigUsb_DEVICE_EXTENSION\' : \'struct\' type redefinition Linking Executable - objchk\\i386\\sigusb.sys for i386 link() : error LNK1181: cannot open input file \"objchk\\i386\\pnp.obj\" BUILD: Done 1 file compiled - 2 Errors - 146 LPS 2 executables built - 2 Errors sigusb.sys - 4 error(s), 0 warning(s) 请高手帮忙分析一下上诉问题的原因 |
|
沙发#
发布于:2003-01-02 13:01
没有看得太仔细
你结构定义的那个.h文件最好用 #ifndef XXXXXXXXXXXX #define XXXXXXXXXXXX #endif 括起来 这样比较安全 |
|
|
板凳#
发布于:2003-01-02 16:51
e:\\zhang\\mydriver\\driver3\\sigusb - 1 source files (440 lines)
只找到一个source files? |
|
|
地板#
发布于:2003-01-02 21:14
谢谢发表意见
我的sources文件只有一个,其中列出的源文件有5个。开始时,5个文件都被编译检查过,等本人将显示的语法错误改完后,就出现了如上的提示。 |
|