安装libusb-1和libudev以获取openni以在Fedora上编译

时间:2014-02-07 08:25:55

标签: fedora openni libusb-1.0

我刚刚改为Fedora 20,我正在尝试习惯并学习它。在我只使用ubuntu之前,我有一些新的东西。

我试图通过从git下载软件包来编译openni_master。第一步是输入

   /OpenNi_Master/Platform/Linux/CreateDist/  

ans跑      sudo ./RedistMaker。

当我这样做时,我得到以下内容:

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

所以我尝试了

  sudo yum install libgusb.x86_64.

运行locate libgusb会给出.so文件

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

但没有libusb-1.0.h。

所以我尝试从网上下载libusb-1.0.18软件包并在我的电脑上编译。 但是在文件夹中运行./configure会给出

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

所以我安装了

  libgudev1-devel.x86_64

  libgudev1.x86_64.

可能我正在安装错误的软件包,但我是Fedora的新手,我真的不知道在哪里搜索它们。

感谢任何帮助!

/ Erik

2 个答案:

答案 0 :(得分:10)

在Fedora(和其他使用yum进行包管理的发行版)中,你可以找出哪个包提供了一个特定的文件:

$ yum provides /path/to/my/file

如果您只知道文件名的一部分,则可以使用通配符:

$ yum provides */myfile

那么,提供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
[...]

因此您需要安装libusbx-devel

答案 1 :(得分:1)

我有类似的问题,但libusb.h存在。

# CFLAGS="-O2 -Wall -march=native " ./configure --enable-scrypt --enable-Avalon
...
checking libudev.h usability... no
checking libudev.h presence... no
checking for libudev.h... no
configure: error: "udev support requested but libudev not installed"
configure: error: ./configure failed for compat/libusb-1.0

通过安装更新​​的libudev修复:

# yum provides */libudev.h
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.clouvider.net
 * epel: ftp-stud.hs-esslingen.de
 * extras: centos.mirroring.pulsant.co.uk
 * rpmforge: fr2.rpmfind.net
 * updates: mozart.ee.ic.ac.uk
libudev-devel-147-2.73.el6_8.2.x86_64 : Development files for libudev
Repo        : base
Matched from:
Filename    : /usr/include/libudev.h

# yum install libudev-devel-147-2.73.el6_8.2.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.clouvider.net
 * epel: ftp-stud.hs-esslingen.de
 * extras: centos.mirroring.pulsant.co.uk
 * rpmforge: fr2.rpmfind.net
 * updates: mozart.ee.ic.ac.uk
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package libudev-devel.x86_64 0:147-2.73.el6_8.2 will be installed
--> Processing Dependency: udev = 147-2.73.el6_8.2 for package: libudev-devel-147-2.73.el6_8.2.x86_64
--> Running transaction check
---> Package udev.x86_64 0:147-2.46.el6 will be updated
---> Package udev.x86_64 0:147-2.73.el6_8.2 will be an update
--> Finished Dependency Resolution

# CFLAGS="-O2 -Wall -march=native " ./configure --enable-scrypt --enable-Avalon
...
checking libudev.h usability... yes
checking libudev.h presence... yes
checking for libudev.h... yes
checking for udev_new in -ludev... yes