LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-06-2010, 05:27 AM   #1
boidi
Member
 
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;
usb_init();
usb_find_busses();
usb_find_devices();
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, 06:31 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Try
Code:
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, 06:44 AM   #3
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

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

Code:
root@btd-techweb01:~# whereis usb.h
usb: /usr/include/usb.h /usr/share/usb.ids
root@btd-techweb01:~# locate usb.h
/etc/hotplug/usb.handmap
/usr/src/linux-2.4.29/drivers/usb/storage/usb.h
/usr/src/linux-2.4.29/drivers/usb/tiglusb.h
/usr/src/linux-2.4.29/drivers/usb/rio500_usb.h
/usr/src/linux-2.4.29/drivers/usb/dabusb.h
/usr/src/linux-2.4.29/drivers/bluetooth/hci_usb.h
/usr/src/linux-2.4.29/include/net/irda/irda-usb.h
/usr/src/linux-2.4.29/include/linux/usb.h
/usr/src/linux-2.4.29/include/config/usb/dabusb.h
/usr/src/linux-2.4.29/include/config/bluez/hcibfusb.h
/usr/src/linux-2.4.29/include/config/bluez/hciusb.h
/usr/src/linux-2.4.29/include/config/input/iforce/usb.h
/usr/src/linux-2.4.29/include/config/usb.h
/usr/src/linux-2.4.29/include/config/video/cpia/usb.h
/usr/include/linux/usb.h
/usr/include/usb.h
/usr/include/pi-usb.h
root@btd-techweb01:~#
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 06:55 AM.
 
  


Reply



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 09:37 PM
USB error: could not claim interface 0: No such file or directory seeism Linux - Hardware 1 07-19-2008 04:40 PM
How to protect a file/directory in your home login directory (RH Linux) jitsenho Linux - Security 9 07-03-2006 11:08 PM
cannot open /proc/bus/usb/devices, No such file or directory aspartat Linux - Software 2 11-02-2005 12:57 PM
minicom: cannot open /dev/usb/tts/0: No such file or directory tcma Linux - Software 1 10-03-2004 07:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:23 AM.

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