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.

相关推荐
无奈笑天下21 分钟前
银河麒麟V10虚拟机安装vmtools报错:/bin/bash解释器错误, 权限不够
linux·运维·服务器·开发语言·经验分享·bash
wdfk_prog1 小时前
[Linux]学习笔记系列 -- [fs]kernfs
linux·笔记·学习
代码游侠1 小时前
学习笔记——IO多路复用技术
linux·运维·数据库·笔记·网络协议·学习
比奇堡派星星1 小时前
Linux Hotplug 机制详解
linux·开发语言·驱动开发
m0_485614672 小时前
Linux-容器基础2
linux·运维·服务器
QT 小鲜肉2 小时前
【Linux命令大全】001.文件管理之mattrib命令(实操篇)
linux·运维·服务器·chrome·笔记
鸠摩智首席音效师2 小时前
如何在 Linux 上自动清理 Journalctl 日志 ?
linux·运维·服务器
鸠摩智首席音效师3 小时前
如何在 Linux 下以 www-data 用户运行 Crontab ?
linux·运维·服务器
wdfk_prog3 小时前
[Linux]学习笔记系列 -- [fs]inode
linux·笔记·学习
iCxhust3 小时前
linux /etc 目录 etc是什么缩写
linux·运维·服务器·php