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.

相关推荐
chinesegf6 小时前
ubuntu中虚拟环境的简单创建和管理
linux·运维·ubuntu
java_logo6 小时前
2025 年 11 月最新 Docker 镜像源加速列表与使用指南
linux·运维·docker·容器·运维开发·kylin
一碗面4217 小时前
Linux下的网络模型
linux·网络模型
HIT_Weston8 小时前
103、【Ubuntu】【Hugo】搭建私人博客:搜索功能(四)
linux·运维·ubuntu
旖旎夜光8 小时前
Linux(11)(中)
linux·网络
txinyu的博客8 小时前
前置声明与 extern
linux·c++
有泽改之_10 小时前
ssh命令使用
linux·运维·ssh
梁洪飞11 小时前
noc 片上网络
linux·arm开发·嵌入式硬件·arm
颜子鱼12 小时前
Linux驱动-INPUT子系统
linux·c语言·驱动开发
Lueeee.13 小时前
llseek 定位设备驱动实验
linux·驱动开发