栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

Linux下uuid 安装、使用问题记录

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Linux下uuid 安装、使用问题记录

项目开发中需要使用guid生成唯一标识,首先需要安装uuid库

sudo apt-get install uuid-dev

否则编译时会出现使用中出现如下错误

fatal error: uuid/uuid.h: No such file or directory #include

安装后输入 ldconfig -p|grep uuid查看安装目录

问题1

error: no matching function for call to ‘rapidjson::PrettyWriter > >::String(std::__cxx11::string&)’ writer.Key("GUID");writer.String(uuidstr);

解决方法:输出json格式信息的时候

writer.Key("GUID");writer.String(uuidstr)改为

writer.Key("GUID");writer.String(uuidstr.c_str());

问题2:

undefined reference to symbol 'uuid_generate@@UUID_1.0'//lib/x86_64-linux-gnu/libuuid.so.1: error adding symbols: DSO missing from command line

解决方法:

尝试网上说的方法,但不生效

sudo rm ~/anaconda3/lib/libuuid.so.1
sudo ln -s /usr/lib/x86_64-linux-gnu/libuuid.so.1 ~/anaconda3/lib/libuuid.so.1

后来测试,在cmakelist文件中,添加链接库uuid,问题解决

target_link_libraries(main ${OpenCV_LIBS} ${CUDA_LIBS} uuid)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/963946.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号