Linux – Creating softlinks to header files that are not in the expected directory

asteriskfedoralinuxsoftware installation

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

I am trying to install asterisks from source and when I run the ./configure script I get the following error:

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)

However, I have already installed the 64 bit versions of uuid and 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

So I guess its looking for the header file and cannot find it.
checking uuid/uuid.h usability… no

When I run locate uuid.h I can see the uuid.h in the following directory:

/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

So in trying to fix the problem I created a new directory /usr/include/uuid and created a softlink to that uuid.h in there.

lrwxrwxrwx. 1 root root 9 Jan 15 11:49 uuid.h -> ../uuid.h

It works now:

checking uuid/uuid.h usability... yes
checking uuid/uuid.h presence... yes
checking for uuid/uuid.h... yes

My question is, is it OK to mess around with installed header files like this by creating softlinks? I always worry in case I break something as you need root access to create the softlink. And many there is another solution without the need to create these softlinks.

Best Answer

I would generally discourage you from manipulating the inclusion of libraries in this way. Just because a file is similarly named does not mean it's the correct header file that you're looking for.

Incidentally, you're looking for this package.

$ sudo yum install libuuid libuuid-devl

The way I found this is how I would always recommend looking for missing files on any Fedora/CentOS/RHEL system.

Example

$ 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
..
Related Question