From 1e33c89f9aabdc5362b8fbd1720cf45d117d888c Mon Sep 17 00:00:00 2001 From: wangyucheng Date: Fri, 21 Apr 2023 13:51:30 +0800 Subject: [PATCH] fix(compile): fix ld error: undefined reference to symbol 'dlclose@@GLIBC_2.2.5' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修复在低于2.34版本的glibc环境中出现的链接错误(从glibc2.34开始,将dl的实现放在了glibc中,所以在glibc2.34的环境中不需要链接dl,但是在低于2.34的环境还是需要链接) --- src/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 041f0dc..c6c2001 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -69,6 +69,7 @@ target_link_libraries(${PROJECT_NAME} Qt5::DBus Qt5::Sql Qt5::Concurrent + ${CMAKE_DL_LIBS} ) target_link_directories(${PROJECT_NAME} PRIVATE -- 2.33.0