未定义参考 uuid_generate ubuntu

发布于 2024-10-06 14:02:05 字数 268 浏览 0 评论 0原文

我已经使用下面的命令安装了 libuuid。

sudo apt-get install uuid-dev

并从终端正确安装。

然后,我包含 头文件。 但是,在调用函数 uuid-generate 时,它​​给出了引用错误

  uuid_t newUUID;
  uuid_generate(newUUID);

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);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

半窗疏影 2024-10-13 14:02:05

您必须链接到 libuuid(请参阅 /usr/lib/libuuid.so 和 /usr/lib/libuuid.a)。添加链接器选项 -luuid 以告诉链接器引用库文件。

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.

无法回应 2024-10-13 14:02:05

我已经解决了上述问题。我没有使用终端来安装 uuid 生成器,而是遵循以下步骤:

  1. 在终端上调用 sudo apt-get install uuid-dev 命令
  2. 转到项目菜单下的属性菜单项,然后通过选择添加包选项来添加 uuid 库。
  3. 然后包含标头#include uuid/uuid.h

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文