undefined reference to symbol ‘pthread_condattr_setclock@@GLIBC_2.3.3‘ 的参考解决方案

写在前面

自己的测试环境:

Ubuntu20.04,PCL 1.10, ROS-Noetic.

一、问题描述

编译PCL 程序的时候报错:

bash 复制代码
/usr/bin/ld: CMakeFiles/passthrough.dir/src/passthrough.cpp.o: undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

二、解决方法

可以试试在CMakeLists.txt 增加

bash 复制代码
find_package(Boost REQUIRED COMPONENTS system chrono thread)

include_directories( ${Boost_INCLUDE_DIRS})

target_link_libraries(passthrough  ${Boost_LIBRARIES})

参考链接

1\] zhidao101. 解决undefined reference to symbol 'pthread_condattr_setclock@@GLIBC_2.3.3' \[EB/OL\]. https://blog.csdn.net/zhidao101/article/details/127730252, 2022-11-07/2023-10-18.

相关推荐
崔小汤呀1 小时前
最全的docker安装笔记,包含CentOS和Ubuntu
linux·后端
何中应1 小时前
vi编辑器使用
linux·后端·操作系统
何中应1 小时前
Linux进程无法被kill
linux·后端·操作系统
何中应1 小时前
rm-rf /命令操作介绍
linux·后端·操作系统
何中应2 小时前
Linux常用命令
linux·操作系统
葛立国2 小时前
从 / 和 /dev 说起:Linux 文件系统与挂载点一文理清
linux
哇哈哈202117 小时前
信号量和信号
linux·c++
不是二师兄的八戒17 小时前
Linux服务器挂载OSS存储的完整实践指南
linux·运维·服务器
一个人旅程~18 小时前
如何用命令行把win10/win11设置为长期暂停更新?
linux·windows·经验分享·电脑
2302_7995257419 小时前
PCI、PCIe 和 NVLink
linux