Results 1 to 5 of 5

Thread: Libusb

  1. #1
    Join Date
    Dec 2017
    Posts
    19
    Thanks
    10
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Libusb

    Hi everyone,
    I tried to execute "testlibusb.c" but following error occurred:
    Qt Code:
    1. :-1: error: No rule to make target '.../LIBUSBTEST/LIBUSB/MinGW32/static/liblibusb-1.0d.a', needed by 'debug\LIBUSBTEST.exe'. Stop.
    To copy to clipboard, switch view to plain text mode 

    I added "libusb.h" by right click on project name and 'add existing files'
    and also "libusb-1.0.a" by right click on project name and 'add library' (static library).

    Qt Code:
    1. HEADERS += \
    2. libusb.h
    3.  
    4. SOURCES += \
    5. testlibusb.c
    6.  
    7. win32:CONFIG(release, debug|release): LIBS += -L$$PWD/LIBUSB/MinGW32/static/ -llibusb-1.0
    8. else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/LIBUSB/MinGW32/static/ -llibusb-1.0d
    9.  
    10. INCLUDEPATH += $$PWD/LIBUSB/MinGW32/static
    11. DEPENDPATH += $$PWD/LIBUSB/MinGW32/static
    12.  
    13. win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/LIBUSB/MinGW32/static/liblibusb-1.0.a
    14. else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/LIBUSB/MinGW32/static/liblibusb-1.0d.a
    15. else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/LIBUSB/MinGW32/static/libusb-1.0.lib
    16. else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/LIBUSB/MinGW32/static/libusb-1.0d.lib
    To copy to clipboard, switch view to plain text mode 

    I do not have any idea what should I do.

  2. #2
    Join Date
    Dec 2017
    Posts
    19
    Thanks
    10
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Libusb

    Does another library exist which can be used in Qt?

  3. #3
    Join Date
    Dec 2017
    Posts
    19
    Thanks
    10
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Libusb

    After few modification following errors occurred:

    Error.jpg

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,481
    Thanks
    252
    Thanked 711 Times in 701 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Libusb

    It looks to me as though you are trying to link to an incompatible version of libusb. It could be incompatible for any number of reasons:

    - it was built with a different compiler,
    - it was built for a different OS (Windows uses .lib / .dll for libraries, not .lib / .a)
    - it was built as debug or release and you are specifying the wrong one to release or debug
    - you are trying to link as static to a DLL
    - you are using a preprocessor #define that is telling the compiler you will be linking to a DLL when you actually aren't

    If you haven't built this libusb yourself, then I would guess it is almost certainly an incompatibility between the library you have and the toolchain you are using to build your app.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. The following user says thank you to d_stranz for this useful post:

    CodeFreak (29th July 2018)

  6. #5
    Join Date
    Dec 2017
    Posts
    19
    Thanks
    10
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Libusb

    Thanks for your reply.
    Last edited by CodeFreak; 29th July 2018 at 20:11.

Similar Threads

  1. Using libusb-1.0 with Qt (MinGW) in Windows 8
    By flammmable in forum Newbie
    Replies: 2
    Last Post: 24th June 2016, 08:10
  2. Linux, libusb and Qt
    By jacaz4 in forum Newbie
    Replies: 8
    Last Post: 30th July 2015, 08:27
  3. Libusb device Connection In Qt-Android-Emulator
    By saad_saadi in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 30th June 2015, 02:53
  4. Using libusb with QT Creator in Windows
    By dching in forum Newbie
    Replies: 1
    Last Post: 5th August 2014, 21:37
  5. linux, libusb, and usb.h include issue
    By Windsoarer in forum Qt Programming
    Replies: 1
    Last Post: 4th July 2012, 09:21

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.