Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

undefined reference uuid_generate ubuntu

Tags:

uuid

ubuntu

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);
like image 712
boom Avatar asked Dec 07 '10 12:12

boom


1 Answers

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.

like image 158
damg Avatar answered Oct 14 '22 20:10

damg