Alex Rivera | Logout

undefined reference uuid_generate ubuntu

Asked 2010-12-07T12:57:14.593
11

I have installed libuuid using the command below.

sudo apt-get install uuid-dev

And is properly installed from the terminal.

Then, i include <uuid/uuid.h> header file. But while calling function uuid-generate as under it is giving reference error

  uuid_t newUUID;
  uuid_generate(newUUID);
Edit
Report

2 Answers

19

You have to link against libuuid (see /usr/lib/libuuid.so and /usr/lib/libuuid.a). Add linker option -luuid to tell the linker to reference the library file.

answered 2010-12-07T13:04:07.697
-6

I have resolved the above issue. Instead of using terminal to install the uuid generator, following is my step that i followed:

  1. call sudo apt-get install uuid-dev command on terminal
  2. Go to properties menu item, under project menu and add uuid library by selecting add package option.
  3. Then do include header #include uuid/uuid.h
answered 2010-12-14T05:02:58.387

Your Answer