Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C
Hi,
 
I am developing an application for interfacing a USB device. When I compile my code I get the following errors. I had included "hidsdi.h" and "hid.lib" is downloaded and pasted in the local directory.
 
error LNK2019: unresolved external symbol _HidD_GetAttributes@8 referenced in function _main
error LNK2019: unresolved external symbol _HidD_GetHidGuid@4 referenced in function _connectToUSBDevice
 
Can anyone help me with this bug.
 
Regards
Mohan
Posted 30-Dec-10 0:31am
Edited 30-Dec-10 0:36am
Slacker00772.2K
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Pasting the hid.lib file in the local directory is not enough. You need to add the hid.lib to the link input.
  Permalink  
Comments
Mohanraj Sam at 30-Dec-10 6:47am
   
Hi,
Thanks for ur reply. I am new to MS Visual Studio 2008 can you say where i have to go to add the hid.lib for link input
 
Regards
Mohan
JF2015 at 30-Dec-10 7:08am
   
try:
 
Just go to project properties -> Configuration properties -> Linker.
Goto to ->General and set the "Additional Library directories" to point to your lib file directory.
 
Then goto to Linker -> Input and type in your lib file name e.g. hid.lib in the "Additional Dependencies" field
Espen Harlinn at 15-Jan-11 10:49am
   
5+ Good answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 485
1 OriginalGriff 280
2 CPallini 230
3 BillWoodruff 230
4 ChauhanAjay 149
0 OriginalGriff 6,609
1 Sergey Alexandrovich Kryukov 6,240
2 CPallini 5,180
3 George Jonsson 3,574
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 30 Dec 2010
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100