468,513 Members | 1,686 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

USB device detection Error calling function to get GUID

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?
Jan 23 '08 #1
2 5409
sicarie
4,677 Expert Mod 4TB
And where is HidD_GetHidGuid() defined?
Jan 23 '08 #2
weaknessforcats
9,207 Expert Mod 8TB
You have to add setupapi.lib in your project as linker input.

Go to project properties, Configuration Properties, Linker, Input and add the library name.
Jan 23 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by FloydPW | last post: by
reply views Thread by Farek | last post: by
reply views Thread by Eddy_w | last post: by
reply views Thread by Lunchtimemama | last post: by
2 posts views Thread by danielle.m.manning | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.