How to install libusb?

I want install libusb in ubuntu 14.04 LTS. I have downloaded libusb-1.0.9.tar.bz2 file from official site "http://libusb.org" but now I am unable to install it. I want to use libusb for Reliance usb for net connection.

As I am new to linux so please mention every command that I need to run in terminal.

Thanks in advance.


This is how you install libusb:

sudo apt-get install libusb-1.0-0-dev

Note that if you are using libusb in a C/C++ program you should include it the following way:

#include <libusb-1.0/libusb.h>

and not like this:

#include <libusb.h>

This is a common mistake that I was making. Finally you compile like this:

g++ source.cpp `pkg-config --libs --cflags libusb-1.0`

Since you are new to linux I suggest running the below command from terminal to install libusb directly from the repository:

>sudo apt-get install libusb-1.0-0-dev

If you wish to continue with the archive you have downloaded, refer to the instructions in the below link:

http://www.linuxfromscratch.org/blfs/view/svn/general/libusb.html