You could follow these instructions: Edison Package Repo Configuration Instructions
to setup you Edison to work with the unofficial package repo.
then you should be able to install libusb-dev by running
opkg install libusb-1.0-dev
Great! It's working well.
However I have also found another solution if anybody want it: I have copied all the header files of libusb (from sources) in /usr/lib/libusb-1.0/ and put some -L flags when compiling. Not really clean though..
Thank you Dan!
I've completed the process outlined above by intel_dan, but I'm having trouble locating the libusb header files. I'm trying to compile libnfc but it always results in the error: "configure: error: The libusb headers are missing".
I have the Edison Breakout Board powered through the DC port on J21, and the USB-OTG cable on J16. lsusb reports back:
Bus 001 Device 002: ID 072f:2200 Advanced Card Systems, Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Which I think would indicate that libusb is operating correctly.
Any idea where the headers are located? Thanks.
The header (AFAICS there's only one usb.h there) is in /usr/include.
The easiest way to check that for the installed package is to use the "opkg files libusb" command.
If you haven't yet installed it, you can use 7-zip to look into the ipk file, which you can get directly from the repo at http://repo.opkg.net/edison/repo
just for heads-up. The version of libusb in that repro is rather old: 1.0.9 instead is the current 1.0.19. The hotplug detection with callback functions is not included in 1.0.9. It is implemented starting from 1.0.16.
I managed to compile ver. 1.0.19 from tarball on Edison and use linusb-1.0.so in Eclipse for cross-compiling. Really quick and dirty. It should be put into "\iotdk-ide-win\devkit-x86\sysroots\i586-poky-linux\usr\lib" where libm.so is located (math lib for sqrt etc) and linked as -lusb-1.0 in the linker preferences. Once compiled on Edison, it can be relocated to /usr/lib or /lib from ..../.lib <== a hidden dir where is lands. Consider relocating everything starting with libusb-1.0* since *.la files are are as important as so-files because they store the list of dynamically liked functions and are used for lookup. *.SO is a kind of *.DLL while *.LA holds the list of functions. It can happen that it compiles nicely in Eclipse, however, you'll get an error while running the program on Edison when the corresponding la-file does not contain the needed function (older version). It was the case after I used so-files of ver 1.0.19 while la-file were still of 1.0.9 (without hotplug stuff). I could compile, but I could not run it on target.
I wish I knew how to compile libusb natively in Eclipse to get *.so. In the same time, I think once compiled on Edison I don't need to bother to transfer them to Edison.