阅读:961回复:1
求助大虾!
我用VC做了个对USB进行读写的程序!
可是出现了如下问题: USBPortDlg.obj : error LNK2001: unresolved external symbol "unsigned char __stdcall HidD_GetAttributes(void *,struct _HIDD_ATTRIBUTES *)" (?HidD_GetAttributes@@YGEPAXPAU_HIDD_ATTRIBUTES@@@Z) USBPortDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiGetDeviceInterfaceDetailA@24 USBPortDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiDestroyDeviceInfoList@4 USBPortDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiEnumDeviceInterfaces@20 USBPortDlg.obj : error LNK2001: unresolved external symbol __imp__SetupDiGetClassDevsA@16 我也在在工程里加了setpapi.lib!#inlcude "setpapi.h" 可是错误依然! 希望大虾们给我指点! |
|
沙发#
发布于:2004-02-03 17:50
菜单project->Setting中,Link页:
Object/library modules加入 C:\NTDDK\lib\i386\free\setupapi.lib C:\NTDDK\libfre\i386\hid.lib 菜单Tools->Option中,Directries中: Show Directries for选择'include files' 然后加上一行C:\NTDDK\INC 改成'Library files' 然后加上一行 C:\NTDDK\LIB 记住: 将 #include "setupapi.h" #include "hidsdi.h" 改成 extern "C" { #include "setupapi.h" #include "hidsdi.h" } 很重要,我在这里花了不少时间. 不过,我编译是通过了,但执行时总找不到USB设备,如果你能找到,告诉我怎么做?vn88@21cn.com |
|