Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QtUsb Examples not building properly #85

Closed
hizzawaseem96 opened this issue Dec 22, 2021 · 2 comments
Closed

QtUsb Examples not building properly #85

hizzawaseem96 opened this issue Dec 22, 2021 · 2 comments
Assignees
Labels

Comments

@hizzawaseem96
Copy link

PLatform:

  • OS: [Windows]
  • Version [10]

Describe the bug
I am trying to build the following example using QUsb. However I am facing the following errors:

image

I am using Qt version 6.2.1. I have built the library using the following steps:

  1. Downloaded v0.7.0-qt5.15-usb-msvc-dynamic-x64.7z and extracted where Qt directory is present
  2. Added Qt5Usb as an External library in the project, where library path is path of Qt5Usb.lib file. I used dynamic linking and selected the platform windows only. I tried static linking earlier but received the following error "Unknown module QTUsb".

The following is my project file:

QT -= gui usb

CONFIG += c++11 console
CONFIG -= app_bundle

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
        main.cpp \
        usbexample.cpp

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

win32:CONFIG(release, debug|release): LIBS += -LG:/qtusblibs/Qt/5.15/msvc2019_64/lib/ -lQt5Usb
else:win32:CONFIG(debug, debug|release): LIBS += -LG:/qtusblibs/Qt/5.15/msvc2019_64/lib/ -lQt5Usbd

INCLUDEPATH += G:/qtusblibs/Qt/5.15/msvc2019_64/include/QtUsb
DEPENDPATH += G:/qtusblibs/Qt/5.15/msvc2019_64/include/QtUsb

HEADERS += \
    usbexample.h

Kindly let me know what is the issue here. Thankyou

@HKH13
Copy link

HKH13 commented Dec 22, 2021

Dear Friend
you should use qt 5.15.2
and you should download libusb too
if you have problem let me know I think I can help you

@fpoussin
Copy link
Owner

Please use the correct Qt version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants