user1806687
user1806687

Reputation: 920

How to import libusb dll

I am using Visual Studio 2013 and have troubles using libusb dll. I have downloaded their source and compiled the dll version under release. New folder was created: D:\libusb-1.0.9\Win32\Release\dll which contains the .lib and .dll files. The next thing I did, was copied the .dll to my Visual studio projects folder, where the source files reside.

In Visual studio I then did: project->properties->linker->input->additional dependencies and pasted in the path to .lib file: D:\libusb-1.0.9\Win32\Release\dll\libusb-1.0.lib. Then I did project->properties->linker->general->additional library directories and pasted in the folder where the libusb header files are: D:\libusb-1.0.9\libusb.

Then I tried including the #include "libusb.h" but it says it cant find the file.

What else do I need to do, to make it work...?

EDIT:

These are the exact errors:

Upvotes: 2

Views: 4836

Answers (1)

drescherjm
drescherjm

Reputation: 10837

The problem is you did not add the folder containing the header file libusb.h to the include folders for your compiler. As a result the compiler can not find libusb.h since it is not in any of the folders the compiler searches.

In Visual Studio to add a folder to the include directories open the project properties for your target and add the folder to the C/C++->General->Additional Include Directories setting.

Upvotes: 4

Related Questions