阅读:3306回复:6
急急急!DDK下的例子USBVIEW怎么在VC下面编译啊?
我想编译一下,比较好理解代码,要不然分不清楚那个函数是属于哪个类的,哪个是自定义的等等,要是谁看过那个代码,说说应该怎么看那个代码。先看哪个文件?分不清次序了
|
|
沙发#
发布于:2003-11-12 11:39
不能编译。要在ddk下编译
|
|
|
板凳#
发布于:2003-11-12 14:26
本人在VC集成环境下编译了,但VC编译环境要进行一定的设置。具体一点就是加入一定的环境变量和LIB文件,具体参见附件说明
|
|
|
地板#
发布于:2003-11-12 16:39
dragon_hn大侠:我用的是winxp,DDK for XP
按照你的方法,编译有很多的错误, :( |
|
地下室#
发布于:2003-11-12 16:42
119个错误,9个警告:
d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(122) : error C2061: syntax error : identifier \'LOG_CONF\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(122) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(123) : error C2143: syntax error : missing \'{\' before \'*\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(128) : error C2061: syntax error : identifier \'RES_DES\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(128) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(129) : error C2143: syntax error : missing \'{\' before \'*\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(146) : error C2061: syntax error : identifier \'RANGE_LIST\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(146) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(147) : error C2143: syntax error : missing \'{\' before \'*\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(152) : error C2061: syntax error : identifier \'RANGE_ELEMENT\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(152) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(153) : error C2143: syntax error : missing \'{\' before \'*\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(164) : error C2061: syntax error : identifier \'CONFLICT_LIST\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(164) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(165) : error C2143: syntax error : missing \'{\' before \'*\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(171) : error C2061: syntax error : identifier \'RES_DES\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(174) : error C2059: syntax error : \'}\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(180) : error C2061: syntax error : identifier \'RES_DES\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(182) : error C2371: \'CD_szDescription\' : redefinition; different basic types d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(173) : see declaration of \'CD_szDescription\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(183) : error C2059: syntax error : \'}\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(189) : error C2061: syntax error : identifier \'CONFLICT_DETAILS\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(189) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(190) : error C2061: syntax error : identifier \'PCONFLICT_DETAILS\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(190) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1097) : error C2146: syntax error : missing \')\' before identifier \'plcLogConf\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1097) : error C2061: syntax error : identifier \'plcLogConf\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1097) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1097) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1101) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1106) : error C2146: syntax error : missing \')\' before identifier \'plcLogConf\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1106) : error C2061: syntax error : identifier \'plcLogConf\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1106) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1106) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1111) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1163) : error C2146: syntax error : missing \')\' before identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1163) : error C2081: \'RANGE_LIST\' : name in formal parameter list illegal d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1163) : error C2061: syntax error : identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1163) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1163) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1165) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1172) : error C2146: syntax error : missing \')\' before identifier \'prdResDes\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1172) : error C2061: syntax error : identifier \'prdResDes\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1172) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1172) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1178) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1183) : error C2146: syntax error : missing \')\' before identifier \'prdResDes\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1183) : error C2061: syntax error : identifier \'prdResDes\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1183) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1183) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1190) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1274) : error C2146: syntax error : missing \')\' before identifier \'prlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1274) : error C2061: syntax error : identifier \'prlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1274) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1274) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1276) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1322) : error C2146: syntax error : missing \')\' before identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1322) : error C2081: \'RANGE_LIST\' : name in formal parameter list illegal d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1322) : error C2061: syntax error : identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1322) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1322) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1324) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1384) : error C2146: syntax error : missing \')\' before identifier \'rlhOld\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1384) : error C2061: syntax error : identifier \'rlhOld\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1384) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1384) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1387) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1485) : error C2146: syntax error : missing \')\' before identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1485) : error C2081: \'RANGE_LIST\' : name in formal parameter list illegal d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1485) : error C2061: syntax error : identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1485) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1485) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1487) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1494) : error C2146: syntax error : missing \')\' before identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1494) : error C2061: syntax error : identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1494) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1494) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1499) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1506) : error C2146: syntax error : missing \')\' before identifier \'lcLogConfToBeFreed\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1506) : error C2061: syntax error : identifier \'lcLogConfToBeFreed\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1506) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1506) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1508) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1513) : error C2146: syntax error : missing \')\' before identifier \'lcLogConfToBeFreed\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1513) : error C2061: syntax error : identifier \'lcLogConfToBeFreed\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1513) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1513) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1516) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1523) : error C2146: syntax error : missing \')\' before identifier \'lcLogConf\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1523) : error C2061: syntax error : identifier \'lcLogConf\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1523) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1524) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1531) : error C2146: syntax error : missing \')\' before identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1531) : error C2061: syntax error : identifier \'rlh\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1531) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1531) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1533) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1540) : error C2146: syntax error : missing \')\' before identifier \'prdResDes\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1540) : error C2061: syntax error : identifier \'prdResDes\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1540) : error C2059: syntax error : \';\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1540) : error C2059: syntax error : \',\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1543) : error C2059: syntax error : \')\' d:\\personal\\microsoft\\vc98\\include\\cfgmgr32.h(1543) : fatal error C1003: error count exceeds 100; stopping compilation usbview.c warning: using obsolete header file usbioctl.h c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(197) : error C2061: syntax error : identifier \'gNotifyDevHandle\' c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(197) : error C2059: syntax error : \';\' c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(198) : error C2061: syntax error : identifier \'gNotifyHubHandle\' c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(198) : error C2059: syntax error : \';\' c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(447) : error C2065: \'DEV_BROADCAST_DEVICEINTERFACE\' : undeclared identifier c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(447) : error C2146: syntax error : missing \';\' before identifier \'broadcastInterface\' c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(447) : error C2065: \'broadcastInterface\' : undeclared identifier c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(451) : error C2224: left of \'.dbcc_size\' must have struct/union type c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(452) : error C2224: left of \'.dbcc_devicetype\' must have struct/union type c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(452) : error C2065: \'DBT_DEVTYP_DEVICEINTERFACE\' : undeclared identifier c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(454) : error C2224: left of \'.dbcc_classguid\' must have struct/union type c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(455) : warning C4090: \'function\' : different \'const\' qualifiers c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(455) : warning C4022: \'memcpy\' : pointer mismatch for actual parameter 1 c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(456) : warning C4022: \'memcpy\' : pointer mismatch for actual parameter 2 c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(456) : error C2198: \'memcpy\' : too few actual parameters c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(458) : error C2065: \'gNotifyDevHandle\' : undeclared identifier c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(458) : warning C4013: \'RegisterDeviceNotification\' undefined; assuming extern returning int c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(460) : error C2065: \'DEVICE_NOTIFY_WINDOW_HANDLE\' : undeclared identifier c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(463) : error C2224: left of \'.dbcc_classguid\' must have struct/union type c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(464) : warning C4090: \'function\' : different \'const\' qualifiers c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(464) : warning C4022: \'memcpy\' : pointer mismatch for actual parameter 1 c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(465) : warning C4022: \'memcpy\' : pointer mismatch for actual parameter 2 c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(465) : error C2198: \'memcpy\' : too few actual parameters c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(467) : error C2065: \'gNotifyHubHandle\' : undeclared identifier c:\\documents and settings\\03070465\\桌面\\2003-11-12_usbview\\usbview.c(594) : warning C4013: \'UnregisterDeviceNotification\' undefined; assuming extern returning int Generating Code... Error executing cl.exe. UsbView.exe - 119 error(s), 9 warning(s) |
|
5楼#
发布于:2003-11-13 17:02
主要是编译环境设置的问题,另外还要在VC的中设置如下:
MENU:TOOLS\\OPTIONS\\DIRECTORIES\\LIBRARY FILES 中设置LIB目录为: E:\\ST_XPDDK\\LIB\\WXP\\I386 其中E:\\ST_XPDDK为XP DDK所安装的目录,因为你用的XP DDK,所以相应的.h文件和.lib文件都找不到,所以编译失败,仔细设置一下看。我是在XP、VC6.0、DDK2000下编译的。 |
|
|
6楼#
发布于:2003-11-14 15:39
还是不行,难道真的要按照论坛上提供的方法设置吗?那么繁琐~
|
|