-
Notifications
You must be signed in to change notification settings - Fork 2k
How to use libusb under MinGW-w64: /ld.exe: cannot find -lusb? #695
Copy link
Copy link
Closed
Labels
Description
The instructions for adding this library to your Visual Studio Code (VSCode) project can be quite skinny. Some people mention "add -lusb" or "add -libusb-1.0" to your tasks.json to make it work; well this may not be specific enough for some.
for reference:
Windows 10, MinGW64 and VSCode.
Try removing both of those commands above and adding the following to your arguments section where I have both mingw 32 and 64 installed on the same machine within my MinGw folder):
"-LI",
"<path to MinGW Lib files>\\libusb-1.0.a"
your compiler command looking something like this: gcc -Wall -o ${fileDirname}\${fileBasenameNoExtension}.exe ${file} -LI C:\MinGW\mingw64\lib\libusb-1.0.a
I was able to compile the included examples testlibusb.c, listdevs.c, etc after doing so.
Reactions are currently unavailable