LinuxQuestions.org
Help answer threads with 0 replies.
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, 06: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, 07: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, 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

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 07:55 AM.
 
  


Reply


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

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

All times are GMT -5. The time now is 09:09 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration