请看以下代码,该代码用于获取连接的 USB 设备列表
#include <lusb0_usb.h>
#include <iostream>
using namespace std;
int main()
{
usb_init();
usb_find_busses();
usb_find_devices();
struct usb_bus *busses = usb_get_busses();
struct usb_bus *bus;
struct usb_device *dev;
for(bus=busses;bus;bus=bus->next)
{
for(dev=bus->devices;dev;dev->next)
{
cout << dev->descriptor.iProduct << endl;
}
}
}
当我运行这段代码时,我得到
Starting C:\Users\yohan\Documents\QTPeojects\USB-build-Desktop_Qt_5_0_0_beta2_MSVC2010_32bit_SDK-Release\release\USB.exe...
C:\Users\yohan\Documents\QTPeojects\USB-build-Desktop_Qt_5_0_0_beta2_MSVC2010_32bit_SDK-Release\release\USB.exe exited with code 0
我相信我做错了这段代码。我该如何纠正?