本文主要是介绍Undefined reference to symbol ‘dlclose@@GLIBC_2.2.5‘ //lib/x86_64-linux-gnu/libdl.so.2,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
我用cmake编译经常遇到一个问题,今天在这里记录一下:
undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
解决方法:
加一个 -ldl,将下面这句话加在CMakeLists.txt里面
set (CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl")
参考链接:
https://stackoverflow.com/questions/23141575/undefined-reference-to-symbol-dso-missing-from-command-line
这篇关于Undefined reference to symbol ‘dlclose@@GLIBC_2.2.5‘ //lib/x86_64-linux-gnu/libdl.so.2的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!