470,870 Members | 1,301 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,870 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;


hDevInfo = SetupDiGetClassDevs(guid,NULL,NULL,DIGCF_PRESENT |


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 :


Can you please tell me what mistake am I making?
Jan 23 '08 #1
2 5483
4,677 Expert Mod 4TB
And where is HidD_GetHidGuid() defined?
Jan 23 '08 #2
9,208 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
By using this site, you agree to our Privacy Policy and Terms of Use.