Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-06-2010, 06:27 AM   #1
Registered: Jun 2010
Location: Bangalore
Posts: 48

Rep: Reputation: 15
usb.h: No such file or directory

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <usb.h>

int main(int argc, char **argv){
struct usb_bus *bus;
struct usb_device *dev;
return 0;

I am compiling this code

gcc libusb.c -o libusb -lusb but it saying error as

usb.h: No such file or directory
Old 07-06-2010, 07:31 AM   #2
Senior Member
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
whereis libusb
It's probably a matter of setting the right -I include dirs where the compiler will search for .h files.
Old 07-06-2010, 07:44 AM   #3
Wim Sturkenboom
Senior Member
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
On my system (Slackware 10.x) that is whereis usb.h

root@btd-techweb01:~# whereis usb.h
usb: /usr/include/usb.h /usr/share/usb.ids
root@btd-techweb01:~# locate usb.h
The second command will only return results if you have run updatedb at least once

PS There is a dedicated programming section at LQ; useful for future programming related questions

Last edited by Wim Sturkenboom; 07-06-2010 at 07:55 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
File directory corrupted on external EXT3 USB drive mocambo Linux - General 3 06-17-2009 10:37 PM
USB error: could not claim interface 0: No such file or directory seeism Linux - Hardware 1 07-19-2008 05:40 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-04-2006 12:08 AM
cannot open /proc/bus/usb/devices, No such file or directory aspartat Linux - Software 2 11-02-2005 01:57 PM
minicom: cannot open /dev/usb/tts/0: No such file or directory tcma Linux - Software 1 10-03-2004 08:02 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:34 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration