Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I obtain/use LibUUID?

Tags:

linux

guid

uuid

gcc

I'm trying to replace a call to ::CoCreateGUID so I can generate GUIDs in a C++ program on Linux.

I understand that libuuid supports this, and I've read this question.

I'm a bit new to Ubuntu/GCC/Linux, so I've started off like this:

#include <uuid/uuid.h> 

And now I'm stuck! :) G++ can't find uuid.h, and I'm not sure how to get/find it.

like image 682
Alex Black Avatar asked Jul 06 '09 23:07

Alex Black


People also ask

What is Libuuid in Linux?

Description. The libuuid library is used to generate unique identifiers for objects that may be accessible beyond the local system. The Linux implementation was created to uniquely identify ext2 filesystems created by a machine.

What is UUID Dev?

Universally Unique ID library - headers and static libraries The libuuid library generates and parses 128-bit Universally Unique IDs (UUIDs). See RFC 4122 for more information. This package contains the development environment for the uuid library.


2 Answers

In Ubuntu, you can do apt-cache search libuuid to see the available packages relating to the text libuuid. Here's my output from Ubuntu 9.04:

$ apt-cache search libuuid libuuid-perl - Perl extension for using UUID interfaces as defined in e2fsprogs libuuid1 - universally unique id library libuuid1-dbg - Debugging information for libuuid1 uuid-dev - universally unique id library - headers and static libraries uuid-runtime - universally unique id library libuuidm-ocaml-dev - Universally unique identifiers for OCaml 

So I think the one you want is uuid-dev, and possibly uuid-runtime. Perform the command sudo apt-get install uuid-dev, and it should install the headers and libraries you need to move on past the problem you're having.

like image 88
Mark Rushakoff Avatar answered Sep 20 '22 13:09

Mark Rushakoff


It's also worth mentioning that this is part of util-linux available here:

http://www.kernel.org/pub/linux/utils/util-linux/

like image 39
hawkbat05 Avatar answered Sep 18 '22 13:09

hawkbat05