Installing libusb-1 and libudev to get openni to compile on Fedora

El_Loco picture El_Loco · Feb 7, 2014 · Viewed 17.7k times · Source

I have just changed to Fedora 20 and I am trying to get used to it and to learn it. Before I have only worked with ubuntu so there are some new things for me.

I have tried to compile openni_master by downloading the package from git. The first step is to enter

   /OpenNi_Master/Platform/Linux/CreateDist/  

ans to run sudo ./RedistMaker .

When I do that I get the following:

  fatal error: libusb-1.0/libusb.h: No such file or directory.

So I tried running

  sudo yum install libgusb.x86_64.

Running locate libgusb gives the .so files

  /usr/lib64/libgusb.so.2
  /usr/lib64/libgusb.so.2.0.3

but no libusb-1.0.h.

So I tried downloading the package libusb-1.0.18 from the web and compile it on my computer. But running ./configure in the folder gives

  checking for libudev.h... no
  configure: error: "udev support requested but libudev not installed"

So I installed

  libgudev1-devel.x86_64

and

  libgudev1.x86_64.

Probably I am installing the wrong packages, but I am new to Fedora and I don't really know where to search for them.

Any help is appreciated!

/ Erik

Answer

smani picture smani · Feb 7, 2014

In Fedora (and other distros using yum for package management), you can find out which package provides a certain file like so:

$ yum provides /path/to/my/file

If you only know a portion of the filename, you can use wildcards:

$ yum provides */myfile

So, what provides libusb.h?

$ yum provides */libusb.h
[...]
libusbx-devel-1.0.17-1.fc21.x86_64 : Development files for libusbx
Repo        : rawhide
Matched from:
Filename    : /usr/include/libusb-1.0/libusb.h
[...]

So you need to install libusbx-devel.