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.

相关推荐
未济3 天前
linux 配置环境变量
linux
傲世仙尊3 天前
目录即文件-Ext文件系统收尾篇
linux·c语言
_艾伦 耶格尔.3 天前
进程间通信
linux
Liuqy-053 天前
Linux IO编程——静态库、动态库
linux
彧azz3 天前
Linux 环境下 Redis 学习总结:数据类型、持久化、锁、事务、主从与缓存问题
linux·redis·笔记·学习·面试
-梅3 天前
linux(8) 软硬链接
linux·运维·服务器
AIgorithmGEEK3 天前
[Linux]线程三部曲(上):一个执行流的诞生——从操作系统一路拆到 pthread_create
linux·线程·pid
琥珀色糖3 天前
SimlpeHttp
linux·服务器
qeen873 天前
【Linux】操作系统之进程介绍(二)
linux·笔记·学习·进程
Zenova EdgeOS3 天前
Linux ss 工业边缘网络分析实战
linux·python·边缘计算·工业网关