Results 1 to 2 of 2

Thread: Using libusb with QT Creator in Windows

  1. #1
    Join Date
    Aug 2014
    Qt products
    Unix/X11 Windows

    Default Using libusb with QT Creator in Windows

    Ok, so I'm having some problems linking the library into my project for QT creator Windows.

    Here is the contents of my .pro file:

    # Project created by QtCreator 2014-08-04T09:44:21

    QT += core gui
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = usb_hid_api
    TEMPLATE = app

    SOURCES += main.cpp\

    HEADERS += mainwindow.h\

    FORMS += mainwindow.ui

    CONFIG += console

    unix|win32: LIBS += -L$$PWD/../libusb_win/MinGW64/static/ -lusb-1.0

    INCLUDEPATH += $$PWD/../libusb_win/include/libusbx-1.0
    DEPENDPATH += $$PWD/../libusb_win/include/libusbx-1.0

    I get as a result of my problems:
    undefined reference to 'libusb_error_name@4' line 16
    undefined reference to 'libusb_init@4' line 32
    (basically a bunch of undefined references).

    Can someone tell me where I'm going wrong?

  2. #2
    Join Date
    Mar 2009
    Brisbane, Australia
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Unix/X11 Windows
    Wiki edits

    Default Re: Using libusb with QT Creator in Windows

    The library is not where you think it is or the static library is not called libusb-1.0.a.

Similar Threads

  1. Replies: 6
    Last Post: 7th November 2012, 06:13
  2. linux, libusb, and usb.h include issue
    By Windsoarer in forum Qt Programming
    Replies: 1
    Last Post: 4th July 2012, 10:21
  3. Qt Creator 2.1.0 and Qt 4.7.2 on Windows
    By OMGHero in forum Newbie
    Replies: 1
    Last Post: 10th March 2011, 23:11
  4. Replies: 7
    Last Post: 3rd December 2009, 17:23
  5. Replies: 2
    Last Post: 26th November 2009, 00:44

Tags for this Thread


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.