未定义对“ uuid_generate@UUID_1.0”的引用

时间:2018-12-05 23:59:26

标签: c++ cmake compilation fedora

我正在开发一个git项目(c ++),直到今天下午,一切都很好。我可以毫无问题地进行编译。 (我应该指出,我是在Fedora 29下工作的)。我当时使用的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 ...)。如果我只是做一个make,OpenMesh(精确地是bin DecimaterGui)就会出现错误。但是,如果我使用make -j 4进行编译,则该错误也会在其他库(和其他bin)中出现。

我可能已经搜索过Internet,但是找不到任何解决方案。或者至少是我的问题的解决方案。因此,如果有人可以指出正确的方向,那真是太酷了!

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

1 个答案:

答案 0 :(得分:0)

您必须卸载libuuid-devel,然后尝试重新安装它:

dnf install libuuid-devel