首页 > 解决方案 > 未定义对“uuid_generate@UUID_1.0”的引用

问题描述

我正在做一个 git 项目(c++),直到今天下午,一切都很好。我可以毫无问题地编译。(我应该指出,我是在 Fedora 29 下工作的) cmake 的一个重大变化发生在更早的时候。我使用的 cmake 版本显然已经不够用了。所以我不得不更新我的cmake(这是我以前从未做过的事情,显然我做错了......首先,我做了:

sudo dnf remove cmake

然后我直接安装了最新版的cmake在官网https://cmake.org/download/(3.13.1)下载

好的,安装显然很顺利。cmake 3.13.1 工作...

现在我正在尝试重新编译项目,然后出现此错误

/usr/bin/ld: //usr/lib64/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
/usr/bin/ld: //usr/lib64/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'

这是更完整的错误:

 [ 69%] Linking CXX executable ../../../../../Build/bin/DecimaterGui
/usr/bin/ld: //usr/lib64/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
/usr/bin/ld: //usr/lib64/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'
collect2: error: ld a retourné le statut de sortie 1
make[5]: *** [src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeFiles/DecimaterGui.dir/build.make:192: Build/bin/DecimaterGui] Error 1
make[4]: *** [CMakeFiles/Makefile2:814: src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeFiles/DecimaterGui.dir/all] Error 2
make[3]: *** [Makefile:152: all] Error 2
make[2]: *** [CMakeFiles/OpenMesh.dir/build.make:111: OpenMesh-prefix/src/OpenMesh-stamp/OpenMesh-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/OpenMesh.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

问题是当我这样做时

sudo dnf remove cmake

我走得太快了,我可能删除了其他有用的数据包......显然,dnf也删除了依赖数据包......我认为这就是问题所在,但这只是一个假设......

我不知道它是否真的有用,但在项目中,我们使用其他 git 项目作为子模块(如 OpenMesh、Assimp ......)。如果我只是制作,OpenMesh 会出现错误(准确地说是 bin DecimaterGui)。但是如果我用 make -j 4 编译,其他库(和其他 bin)也会出现错误。

我可能已经搜索了互联网,但我找不到任何解决方案。或者至少解决我的问题。所以,如果有人能指出我正确的方向,那就太酷了!

我希望我很准确,并且我的英语足够清楚。预先感谢您的回答。

标签: c++cmakecompilationfedora

解决方案


你一定已经卸载了 libuuid-devel,尝试重新安装它:

dnf install libuuid-devel

推荐阅读