Missing 'usb.h' file when installing package.

Asked by DaveR

Hello world,

Summary:
What is 'usb.h'?
-- Is this a system specific file that should be installed with my OS?
--Is it a software specific file that should be included with the source code I'm compiling?
-- Is it generically replaceable by download?
-- Can I write this file from scratch?

Expansion:
Very new to Ubuntu. Working my way through installations of my desired software (GNU-RADIO and GNSS-SDR).
While trying to configure a certain piece of hardware (SiGe GN3S Sampler v2) as an RF-Front End for the software, I received the following errors:

dsradin@dsradin-HP-Pavilion-dv6-Notebook-PC:~/gnss-sdr/drivers/gr-gn3s/build$ make
Scanning dependencies of target gr-gn3s
[ 6%] Building CXX object lib/CMakeFiles/gr-gn3s.dir/gn3s_source_cc.cc.o
In file included from /home/dsradin/gnss-sdr/drivers/gr-gn3s/include/fusb.h:26:0,
                 from /home/dsradin/gnss-sdr/drivers/gr-gn3s/include/gn3s.h:40,
                 from /home/dsradin/gnss-sdr/drivers/gr-gn3s/include/gn3s_source.h:30,
                 from /home/dsradin/gnss-sdr/drivers/gr-gn3s/include/gn3s_source_cc.h:35,
                 from /home/dsradin/gnss-sdr/drivers/gr-gn3s/lib/gn3s_source_cc.cc:34:
/home/dsradin/gnss-sdr/drivers/gr-gn3s/include/libusb_types.h:32:17: fatal error: usb.h: No such file or directory
 #include <usb.h>
                 ^
compilation terminated.
make[2]: *** [lib/CMakeFiles/gr-gn3s.dir/gn3s_source_cc.cc.o] Error 1
make[1]: *** [lib/CMakeFiles/gr-gn3s.dir/all] Error 2
make: *** [all] Error 2

I tried looking through the system to find the files with no joy:

dsradin@dsradin-HP-Pavilion-dv6-Notebook-PC:~/gnss-sdr/drivers/gr-gn3s/build$ whereis usb.h
usb:
dsradin@dsradin-HP-Pavilion-dv6-Notebook-PC:~/gnss-sdr/drivers/gr-gn3s/build$ whereis libusb
libusb:

The excerpt from the readme I am following with the instructions say:
* Build GN3S V2 Custom firmware and driver (OPTIONAL)

- Go to GR-GN3S root directory, compile and install the driver:
  (read the drivers/gr-gn3s/README for more information)

$ cd gnss-sdr/drivers/gr-gn3s
$ cd build
$ cmake ../
$ make
$ sudo make install
$ sudo ldconfig

- Set the environment variable GN3S_DRIVER=1 in order to enable the GN3S_Signal_Source in GNSS-SDR (OPTIONAL)

$ export GN3S_DRIVER=1

In order to gain access to USB ports, gnss-sdr should be used as root.
In addition, the driver requires access to the GN3S firmware binary file.
It should be available in the same path where the application is called.
GNSS-SDR comes with a pre-compiled custom GN3S firmware available at gnss-sdr/firmware/GN3S_v2/bin/gn3s_firmware.ihx.
Please copy this file to the application path. The GNSS-SDR default path is gnss-sdr/install

(in order to disable the GN3S_Signal_Source compilation, you should remove the GN3S_DRIVER variable and build again GNSS-SDR)

I have uninstalled all packages related and re-cloned the GIT repositories that house all the relevant source codes and scoured the internet but without more information about what exactly I'm looking for I'm stuck.

Any suggestions??
Thank you for your help!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
DaveR
Solved:
Last query:
Last reply:
Revision history for this message
Ubfan (ubfan1) said :
#1

Try installing the libusb-dev package, that comes with a /usr/include/usb.h file.
locate usb.h will list all the ones currently on the system (there are many).
apt-file search usb.h will list the packages containing usb.h (again many)

Revision history for this message
Thomas Krüger (thkrueger) said :
#2

The answers to your 4 questions:

1. Yes and no. It CAN be install from the Ubuntu repositories (see Ubfan's answer) but only on demand and not as the only way.
2. No, it's a library uses by a lot of software
3. Yes. But you it has to fit the compiled dynamically loaded library you run the program with.
4. In theory it's possible, but it would require a lot of knowledge about C programming and would be the reinvention of the wheel.

Revision history for this message
Mark Rijckenberg (markrijckenberg) said :
#3

Looks like this issue has already been solved here:

http://askubuntu.com/questions/503928/missing-usb-h-file-what-is-it-where-do-i-get-it

@DaveR: please set the thread status to solved, if this issue is still solved.

Thanks.

Revision history for this message
DaveR (david-radin) said :
#4

Thanks all for your help!

The libusb-dev package worked great.

Appreciate the other comments as well. Cheers all.