Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently installed the library libusb by doing this:

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

I have a directory with examples that looks like this:

penguin@penguin-Satellite-A505:~/Downloads/libusb-1.0.0/examples$ ls -la
total 124
drwxrwxrwx 3 penguin penguin 4096 2011-10-23 11:38 .
drwxrwxrwx 5 penguin penguin 4096 2011-10-23 11:38 ..
drwxrwxr-x 2 penguin penguin 4096 2011-10-23 11:38 .deps
-rw-r--r-- 1 penguin penguin 10781 2008-08-22 22:57 dpfp.c
-rw-r--r-- 1 penguin penguin 11644 2008-06-24 21:00 dpfp_threaded.c
-rw-r--r-- 1 penguin penguin 1643 2008-11-03 15:13 lsusb.c
-rw-rw-r-- 1 penguin penguin 15923 2011-10-23 11:38 Makefile
-rw-r--r-- 1 penguin penguin 356 2008-11-20 08:24
-rw-r--r-- 1 penguin penguin 16380 2008-12-13 12:07

I am trying to compile lsusb.c. Would anyone know how to do it? My OS is Ubuntu 11.1.

Thank You!

share|improve this question

The answer lies in looking at the list of files installed by the libusb-1.0-1-dev package at The source code should read like this:

#include <libusb-1.0/libusb.h>

Also the -L switch must be used with the compiler so the libraries can be located at the location installed.

share|improve this answer

There are makefiles in the directory, so try just running make.

share|improve this answer

I noticed that Ubuntu 11.04 installs with libusb-1.0, but 11.10 installs with libusb-0.1. Does anyone happen to know more about the apparent backrevving of the lib?

I tried a few times (unsuccessfully) to manually build and install libusb-1.0 to Ubuntu 11.10, but wasn't able to. Haven't exactly tried the procedure above.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.