Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Linking with usb library
Linking with usb library [message #10258] |
Thu, 28 June 2007 01:52 |
malaugh
Messages: 7 Registered: June 2007
|
Promising Member |
|
|
Forgive my basic questions but I an a newbee at Linux programming and Ultimate++.
I am writing a program that communicates with a USB device. It uses the function usb_init(), usb_open() etc., which are contained in a library called libusb.a in the /usr/lib directory. I wrote a simple console program to test the libary interface
usb_init();
usb_find_busses();
usb_find_devices();
usb_busses = usb_get_busses();
for (bus = usb_busses; bus; bus = bus->next)
{
for (dev = bus->devices; dev; dev = dev->next)
{
printf("idVendor:0x%04x\n",dev->descriptor.idVendor);
printf("idProduct:0x%04x\n",dev-descriptor.idProduct);
}
}
return 0;
I can compile and run this program with the following gcc command:
gcc UsbList.cpp -lusb -lstdc++ -o UsbList
When I try to compile and run it under Ultimate++ I get
linker errors, it cannot find usb_init, usb_find_busses, usb_find_devices, or usb_get_busses.
How to I tell Ultimate++ to link with the usb library?
Thanks
|
|
|
Goto Forum:
Current Time: Mon May 13 09:07:13 CEST 2024
Total time taken to generate the page: 0.02255 seconds
|