创建指向不在预期目录中的头文件的软链接

ant*_*009 5 linux fedora software-installation asterisk

3.12.6-300.fc20.x86_64 #1 SMP Mon Dec 23 16:44:31 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Fedora 20
Run Code Online (Sandbox Code Playgroud)

我正在尝试从源代码安装星号,当我运行 ./configure 脚本时,出现以下错误:

checking for uuid_generate_random in -luuid... yes
checking uuid/uuid.h usability... no
checking uuid/uuid.h presence... no
checking for uuid/uuid.h... no
checking for uuid_generate_random in -le2fs-uuid... no
checking for uuid_generate_random... no
configure: error: *** uuid support not found (this typically means the uuid development package is missing)
Run Code Online (Sandbox Code Playgroud)

但是,我已经安装了 64 位版本的 uuid 和 uuid-devel

Name        : uuid-devel
Arch        : x86_64
Version     : 1.6.2
Release     : 21.fc20
Size        : 21 k
Repo        : installed   
Name        : uuid
Arch        : x86_64
Version     : 1.6.2
Release     : 21.fc20
Size        : 116 k
Repo        : installed
Run Code Online (Sandbox Code Playgroud)

所以我猜它正在寻找头文件并且找不到它。检查 uuid/uuid.h 可用性...没有

当我运行时,locate uuid.h我可以在以下目录中看到 uuid.h:

/usr/include/uuid.h
/usr/include/linux/uuid.h
/usr/src/kernels/3.12.6-300.fc20.x86_64+debug/include/linux/uuid.h
/usr/src/kernels/3.12.6-300.fc20.x86_64+debug/include/uapi/linux/uuid.h
/usr/src/kernels/3.12.7-300.fc20.x86_64+debug/include/linux/uuid.h
/usr/src/kernels/3.12.7-300.fc20.x86_64+debug/include/uapi/linux/uuid.h
Run Code Online (Sandbox Code Playgroud)

所以为了解决这个问题,我创建了一个新目录 /usr/include/uuid 并在那里创建了一个指向该 uuid.h 的软链接。

lrwxrwxrwx. 1 root root 9 Jan 15 11:49 uuid.h -> ../uuid.h
Run Code Online (Sandbox Code Playgroud)

它现在有效:

checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes
Run Code Online (Sandbox Code Playgroud)

我的问题是,通过创建软链接来处理像这样安装的头文件可以吗?我总是担心万一我破坏了某些东西,因为您需要 root 访问权限来创建软链接。许多还有另一种解决方案,无需创建这些软链接。

slm*_*slm 5

我通常会阻止您以这种方式操纵库的包含。仅仅因为文件的名称相似并不意味着它就是您要查找的正确头文件。

顺便说一下,您正在寻找这个包。

$ sudo yum install libuuid libuuid-devl
Run Code Online (Sandbox Code Playgroud)

我发现这是我始终建议在任何 Fedora/CentOS/RHEL 系统上查找丢失文件的方式。

例子

$ sudo yum whatprovides "*/uuid/uuid.h"
...
libuuid-devel-2.23.1-3.fc19.i686 : Universally unique ID library
Repo        : fedora
Matched from:
Filename    : /usr/include/uuid/uuid.h



libuuid-devel-2.23.1-3.fc19.x86_64 : Universally unique ID library
Repo        : fedora
Matched from:
Filename    : /usr/include/uuid/uuid.h



libuuid-devel-2.23.2-4.fc19.i686 : Universally unique ID library
Repo        : updates
Matched from:
Filename    : /usr/include/uuid/uuid.h
..
Run Code Online (Sandbox Code Playgroud)