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.

相关推荐
程序员-Benothing7 小时前
Linux安全加固指南:账号、权限、服务、审计基线
linux·运维·安全
木子欢儿10 小时前
openconnect Linux客户端安装 以及开机自启和登录
linux·运维·服务器
..Dauntless..10 小时前
【Linux】文件系统(一)
linux·运维·服务器
GeW13 小时前
新质生产力路线图:从Linux到数据库,企业落地要点都在这
linux
IMPYLH13 小时前
Linux 系统备份与镜像
linux·服务器·网络
qetfw13 小时前
Bash 字符串处理:参数展开、序列与脚本执行方式
linux·开发语言·chrome·bash
hhwyqwqhhwy13 小时前
设备树之 provider 和 consumer
java·linux·前端
aaa最北边14 小时前
Linux 上的交叉编译
linux·运维·服务器
小张成长计划..14 小时前
【Linux】27:日志
linux·运维·服务器
别动我齐刘海15 小时前
机器人 C++ / 系统联调补强2——异常处理、Protobuf
linux·c++·人工智能·学习·算法·机器学习·机器人