libusb is an open source, cross-platform and totally free library software implemented in C and designed from the offset to provide generic access to USB (Universal Serial Bus) devices under Linux, Android, BSD (FreeBSD, OpenBSD, NetBSD), Microsoft Windows, Windows CE and Darwin/Mac OS X operating systems.
The library is engineered in such a way that it can be easily and quickly ported to other operating systems. Those of you who want to port libusb to a specific OS, should take a look at the PORTING file found inside the source archive. Building and installing the libusb library is an easy task, as described in the next section.
Getting started with libusb
To compile, install and use the libusb library on your projects under a GNU/Linux operating systems, first download the latest version of the software from Softpedia or via its official website (see link at the end of the article), save the archive somewhere on your computer, extract it and open your favorite terminal emulator application.
Use the ‘cd’ command to navigate to the location of the extracted archive files (e.g. cd /home/softpedia/libusb-1.0.19) and type the ‘sh autogen.sh’ command to configure the project, as well as to generate the ‘configure’ script, which can be used to optimize the program for your hardware architecture or enable various options (see the ‘./configure --help’ command for details).
If you choose not to optimize/re-configure the program, simply type the ‘make’ command to compile it. After a successful compilation, which shouldn’t take more than a few seconds, you can install libusb system wide by executing the ‘sudo make install’ command as a privileged user or the ‘make install’ command as root. You can now integrate it into your own application, so it can access USB devices.