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.

相关推荐
少司府9 小时前
嵌入式外设篇(二)GPIO·二:GPIO输出与LED控制
linux·stm32·单片机·嵌入式硬件·mcu·51单片机·系统
Rabitebla10 小时前
【Linux操作系统】 文件篇(一):文件描述符与 Linux 文件管理机制
linux·网络·c++·笔记·学习
发疯的技术鼠11 小时前
03-优先级与调度
linux
无足鸟ICT13 小时前
【RHCA+】sosreport(收集诊断文档)
linux·运维·服务器
GeW13 小时前
世界目光聚焦中国:底层技术、Linux、数据库的破局逻辑
linux·数据库
星恒随风15 小时前
MySQL 从零入门(十):MVCC、Undo Log 与 Read View 详解——InnoDB 如何实现事务隔离?
linux·数据库·笔记·sql·mysql
瑞雪兆丰年兮16 小时前
Linux零基础快速入门-第二章 Linux基础命令
linux·运维·服务器
咋的啥名都用不了呢~18 小时前
Linux项目部署6(安装Elasticsearch)
linux
无奈笑天下20 小时前
银河麒麟桌面上USB打印机无法打印问题标准处理流程
linux·运维·网络协议
15Moonlight20 小时前
Linux 网络(11):IO 多路转接(select /poll/epoll)
linux·网络