From 63e1a133110532c2bf812af0e41d5439160d470f Mon Sep 17 00:00:00 2001 From: chenzk <9971827+chenzhikang@users.noreply.github.com> Date: Wed, 19 Aug 2020 10:28:22 +0800 Subject: [PATCH] append libpthread.so.0 CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit without libpthread.so.0,it will throw error when executing make: /bin/ld: /home/xxx/mysql-sniffer/lib/libgthread-2.0.a(gthread-impl.o): undefined reference to symbol 'pthread_join@@GLIBC_2.2.5' //usr/lib64/libpthread.so.0: 无法添加符号: DSO missing from command line collect2: 错误:ld 返回 1 make[2]: *** [bin/CMakeFiles/mysql-sniffer.dir/build.make:159:bin/mysql-sniffer] 错误 1 make[1]: *** [CMakeFiles/Makefile2:86:bin/CMakeFiles/mysql-sniffer.dir/all] 错误 2 make: *** [Makefile:84:all] 错误 2 --- src/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 63b4c5e..ca0906e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -31,6 +31,7 @@ EXECUTE_PROCESS(COMMAND make ADD_EXECUTABLE(mysql-sniffer ${SRC_LIST}) TARGET_LINK_LIBRARIES(mysql-sniffer optimized libnidstcpreasm.a + libpthread.so.0 libnet.a libpcap.a libglib-2.0.a @@ -39,6 +40,7 @@ TARGET_LINK_LIBRARIES(mysql-sniffer optimized TARGET_LINK_LIBRARIES(mysql-sniffer debug libnidstcpreasm-dbg.a + libpthread.so.0 libnet.a libpcap.a libglib-2.0.a