I am trying to write an application that will detect all the USB devices connected to my computer. For this I have declared GUID and called the following functions to get the information about devices connected.
LPGUID guid;
HidD_GetHidGuid(guid);
HDEVINFO hDevInfo;
hDevInfo = SetupDiGetClassDevs(guid,NULL,NULL,DIGCF_PRESENT |
DIGCF_INTERFACEDEVICE);
But it give the following error ….
error LNK2019: unresolved external symbol _imp__SetupDiGetClassDevsA@16 referenced in function "public: void __thiscall
error LNK2019: unresolved external symbol "void __stdcall HidD_GetHidGuid(struct _GUID *)"
fatal error : LNK1120: 2 unresolved externals
I don’t understand that where am I making mistake? I have include the following header files :
Hidclass.h
Setupapi.h
Hidsdi.h
Can you please tell me what mistake am I making?