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.

相关推荐
木下~learning3 分钟前
Linux 驱动:RK3399 从零手写 GT911 电容触摸屏驱动(完整可运行)
linux·运维·服务器
摸爬滚打的小李8 分钟前
tmux命令
linux
@LuckY BoY1 小时前
Linux Mint 上开启 VNC 远程桌面
linux·运维·服务器
清平乐的技术专栏1 小时前
Python依赖包实现window下载上传到Linux
linux·开发语言·python
ywgcsxue1 小时前
在麒麟V10上源码编译安装Nginx
linux·运维·服务器·nginx
somi72 小时前
ARM-05-Platform + DTS + GPIO子系统 + 中断 + 等待队列 + 错误处理
linux·运维·arm开发
满天星83035772 小时前
【MySQL】索引
linux·服务器·数据库·mysql
T0uken2 小时前
【Linux】耗时任务执行并邮件通知
linux·运维·服务器
c++逐梦人2 小时前
Linux生产者消费者模型
linux
网络安全许木3 小时前
自学渗透测试第16天(Linux文本处理进阶)
linux·运维·服务器·网络安全·渗透测试