I am trying to write an application that uses the winusb. I do have winusb.h included but I got LNK2019 errors for all the methods from winusb.h being called in the application I wrote. Could some one please help me how to fix this? Below is an example of the errors I got.
Error 1 error LNK2019: unresolved external symbol xxxxx@8 referenced in function xxxxx@8 C:\Users\Trey\Documents\GitRepo\FSCC_USB_driver\Sample KMDF Function Driver for OSR USB-FX2\C++\exe\testapp.obj osrusbfx2 (Exe\osrusbfx2)
From: xxxxx@gmail.com Sent: Wednesday, June 24, 2015 9:53 AM To: Windows System Software Devs Interest List Subject: [ntdev] unresolved external symbol for WinUsb_ReadPipe?
I am trying to write an application that uses the winusb. I do have winusb.h included but I got LNK2019 errors for all the methods from winusb.h being called in the application I wrote. Could some one please help me how to fix this? Below is an example of the errors I got.
Error 1 error LNK2019: unresolved external symbol xxxxx@8 referenced in function _GetWinUSBHandle@8 C:\Users\Trey\Documents\GitRepo\FSCC_USB_driver\Sample KMDF Function Driver for OSR USB-FX2\C++\exe\testapp.obj osrusbfx2 (Exe\osrusbfx2)
WinUsb.h declares the WinUsb function prototypes so that your code can compile, but you need to link to the library that actually implements those functions in order to assemble your final executable. See this for VS specifically:
You need to configure the project’s linker settings and add $(SDK_LIB_PATH)\winusb.lib to the list of libraries you are linking against
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, June 24, 2015 10:03 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] unresolved external symbol for WinUsb_ReadPipe?
Hi Doron,
What do you mean by link against? I am using Visual Studio 2013. I included the winusb.h. Is there other things I need to do to link to the library?
What do you mean by link against? I am using Visual Studio 2013. I included the winusb.h. Is there other things I need to do to link to the library?
Of course you do. The “include” file gets you the compile-time
definitions. Somehow, the linker has to find an object file that has
the actual code. When you call GetDC, that gets satisfied by
gdi32.lib. When you call GetMessage, that gets satisfied by
user32.lib. When you make socket calls, you have to specify the Winsock
library, ws2_32.lib. It’s the same thing here.
Add this: #pragma comment( lib, “winusb.lib” )
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
Add this: #pragma comment( lib, “winusb.lib” )
it never ceases to amaze how simple things are buried under the
mososauristic yobibytes of project settings
omg thanks you just reimbursed me Rs 1k and made me younger by 3
hours which i spent wikiing imdbing youtubing whatnotting and
conceding defeat to my daughter who claimed mosa eats tyra