Hello!
I try to connect device (STM32-Nucleo) with PC via USB.
I have downloaded Qt-5.7.0 with MinGW-5.3.0 and libusb-1.0.20.
(folders of libusb-1.0.20)
libusb-1.0.20
examples
include
libusb-1.0
libusb.h
MinGW32
dll
libusb-1.0.dll
libusb-1.0.dll.a
static
libusb-1.0.a
MinGW64
MS32
MS64
libusb-1.0.def
README.txt
libusb-1.0.20
examples
include
libusb-1.0
libusb.h
MinGW32
dll
libusb-1.0.dll
libusb-1.0.dll.a
static
libusb-1.0.a
MinGW64
MS32
MS64
libusb-1.0.def
README.txt
To copy to clipboard, switch view to plain text mode
1. I have created an empty project
2. added to .pro
INCLUDEPATH += C:\Qt\libusb-1.0.20\include\libusb-1.0\
LIBS += C:\Qt\libusb-1.0.20\MinGW32\static\libusb-1.0.a
INCLUDEPATH += C:\Qt\libusb-1.0.20\include\libusb-1.0\
LIBS += C:\Qt\libusb-1.0.20\MinGW32\static\libusb-1.0.a
To copy to clipboard, switch view to plain text mode
3. added to main.cpp
#include <libusb.h>
#include <libusb.h>
To copy to clipboard, switch view to plain text mode
(then autosubstitution showed functions from libusb)
4. added call of libusb_init(NULL);
int main(int argc, char *argv[])
{
libusb_init(NULL);
MainWindow w;
w.show();
return a.exec();
}
int main(int argc, char *argv[])
{
libusb_init(NULL);
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
But. There is an error
In function `Z5qMainiPPc':
undefined reference to `libusb_init@4'
Can someone tell me where I'm going wrong?
Bookmarks