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.

相关推荐
diygwcom12 小时前
jeecg验证码在centos报错
linux·运维·centos
坚持就完事了12 小时前
Linux中的tar命令
linux·运维·服务器
数据雕塑家13 小时前
Linux磁盘性能测试完全指南:使用FIO深入评估存储系统
linux·运维·服务器
一直会游泳的小猫13 小时前
Homebrew - macOS 与 Linux 的包管理器
linux·运维·macos·brew·包管理工具
代码论斤卖13 小时前
OpenHarmony的watchdog service频繁崩溃问题分析
linux·harmonyos
halazi10013 小时前
WSL 安装与 Ubuntu 24.04 配置使用指南
linux·运维·ubuntu·wsl
拾贰_C13 小时前
【Ubuntu | Nvidia | driver | installation | commend】
linux·运维·ubuntu
.柒宇.13 小时前
Linux 时间同步服务:Chrony 深度笔记
linux·运维·服务器
Strugglingler13 小时前
Linux Device Drivers-第六章 高级字符驱动操作
linux·笔记
青瓦梦滋14 小时前
Linux线程的同步与互斥
linux·c++