I'm trying to build a Qt project on QtCreator on Windows (already works on Ubuntu). I would like to build it on Debug mode and then on Release mode as I wish to deploy my app to Windows.
When 1st compiling the project, I had the following error C1083: Cannot open include file 'libusb.h' no such file or directory
. I solved this error by copying the libusb.h file from E:\Qt\5.11.2\Src\qtwebengine\src\3rdparty\chromium\third_party\libusb\src\libusb
into my compiler folder : E:\Qt\5.11.2\msvc2017_64\include
.
After cleaning and compiling the project again, I have another error for which I can't find a solution, even though I googled it and tried to change the LIB += -lusb-1.0
line of my .pro file. Here is the error: LNK1104: cannot open file
usb-1.0.lib`
Here is my project file :
QT += quick core
CONFIG += c++11
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += \
main.cpp \
readthread.cpp \
passerelle.cpp
RESOURCES += qml.qrc
QML_IMPORT_PATH =
QML_DESIGNER_IMPORT_PATH =
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
HEADER += \
readthread.h \
passerelle.h
LIBS += -lusb-1.0
I call #include <libusb.h>
in the readthread.h file.
Would you happen to know how to fix this, and why is the compiler looking for usb-1.0.lib
instead of libusb-1.0.lib
?
I already tried copying the libusb-1.0.lib file from the downloaded Latest Windows Binary downloads folder (libusb-1.0.22\MS64\dll\libusb-1.0.lib) but it didn't change anything...