Hi,
I want to use libusb in Qt Creator on linux mint.

I added libusb as external library.
in .pro file:
Qt Code:
  1. QT += core gui
  2.  
  3. greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
  4.  
  5. TARGET = test_libusb
  6. TEMPLATE = app
  7.  
  8.  
  9. SOURCES += main.cpp\
  10. mainwindow.cpp
  11.  
  12. HEADERS += mainwindow.h
  13.  
  14. FORMS += mainwindow.ui
  15.  
  16. unix:!macx: LIBS += -L$$PWD/../../../../../../usr/local/lib/ -lusb-1.0
  17.  
  18. INCLUDEPATH += $$PWD/../../../../../../usr/local/include
  19. DEPENDPATH += $$PWD/../../../../../../usr/local/include
  20.  
  21. unix:!macx: PRE_TARGETDEPS += $$PWD/../../../../../../usr/local/lib/libusb-1.0.a
To copy to clipboard, switch view to plain text mode 

in main.cpp:
Qt Code:
  1. #include "mainwindow.h"
  2. #include <QApplication>
  3. #include <libusb-1.0/libusb.h>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8. MainWindow w;
  9.  
  10. libusb_context ctx;
  11.  
  12. libusb_init( &ctx );
  13.  
  14.  
  15. w.show();
  16.  
  17. return a.exec();
  18. }
To copy to clipboard, switch view to plain text mode 

but, when I compile project, I get error:
../test_libusb/main.cpp:10:20: error: aggregate 'libusb_context ctx' has incomplete type and cannot be defined
Can you help? Please.