Thanks very much, birdman. That helped get past that problem, almost. After I brought in the -dev files, gcc could not fine libusb.h, even though it was located in /usr/include/libusb-1.0/libusb.h. I was able to get around that problem by simply moving this file to /usr/include/libusb.h. I don't understand why, but it worked. Next, the compiler was happy, but the linker complained:
/tmp/cc0M1IR3.o: In function `main': FirstUsb.c:(.text+0x1a8): undefined reference to `libusb_init' FirstUsb.c:(.text+0x1f0): undefined reference to `libusb_set_debug' FirstUsb.c:(.text+0x208): undefined reference to `libusb_get_device_list' FirstUsb.c:(.text+0x260): undefined reference to `libusb_get_device_descriptor' FirstUsb.c:(.text+0x320): undefined reference to `libusb_open' FirstUsb.c:(.text+0x370): undefined reference to `libusb_kernel_driver_active' ... FirstUsb.c:(.text+0x940): undefined reference to `libusb_free_device_list' FirstUsb.c:(.text+0x950): undefined reference to `libusb_close' FirstUsb.c:(.text+0x958): undefined reference to `libusb_exit' collect2: ld returned 1 exit status
This problem was cured by changing the gcc invocation line from:
I'm newbie to Linux, plug computers, but I'm totally sold on the plug. I've been doing computer-based product development for a couple of decands, and I think the plug is a great idea with a future.
I'm porting an application from another Linux computer (Atom processor, Ubuntu 9.04). My application talks to a Cypress chip over USB. Right now it collects temperature information from a thermistor, but now that I know how to communicate from the Cypress to Linux, there will be more applications to come. Linking on the Atom was no problem, but when I use this simple command line:
gcc Usbprogram.c -lusb-1.0 -lm (simplified from the Makefile)
I get:
/usr/bin/ld: cannot find -lusb-1.0
I got the same type of response when I tried to compile the libusb-0.1 program shown elsewhere on this forum. I installed both libusb-1.0 and 0.1 using apt-get install. Both have shared object links, but both give this same error. I'm sure I'm missing something simple, but I can't figure it out.
I'm stuck, and I would appreciate any help you can offer. Thank you!