因为最近项目需要用到USB,看到网上很多前辈已经写过步骤,拿来验证一下,发现有问题。
第一步,用比较普遍的教程,https://blog.csdn.net/weixin_38165614/article/details/106380061
,写的特别好,比较容易入手,然后发现如下问题
https://github.com/libusb/libusb/issues/80;
给中undef。
第二步,尝试解决
demonplus at stackoverflow had the solution to my problem and it links and runs now
https://msdn.microsoft.com/en-us/library/windows/hardware/ff551015(v=vs.85).aspx
You need to link additional libraries for windows, add in your .pro file:
win32 {
LIBS += -lhid -lsetupapi
}
QT.pro直接加入LIBS+,运行,不报错了,看起来可以,然鹅,run,ok
nothing!!! 郁闷
第三步,将设备接上电脑,重新来一遍,依然没变化,所以正常应该是什么内容呢,明天继续吧。
时间来到第二天,认真看了一下程序,发现本来就是靠printf输出的,程序没有问题。