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.

相关推荐
jingyu飞鸟21 分钟前
linux系统源代码安装apache、编译隐藏版本号
linux·运维·apache
世事如云有卷舒25 分钟前
Ubunt20.04搭建GitLab服务器,并借助cpolar实现公网访问
linux·服务器·gitlab
2401_858286111 小时前
OS15.【Linux】gdb调试器的简单使用
linux·运维·服务器·开发语言·gdb
zjw_rp3 小时前
centos停止维护后更换yum源
linux·运维·centos
行止64 小时前
OpenStack云平台管理
linux·openstack
岁岁岁平安5 小时前
CentOS-7-x86_64解决:使用NAT模式无法ping通www.baidu.com或无法ping 8.8.8.8问题。
linux·运维·centos·centos-7
运维小贺5 小时前
各服务器厂商调整BIOS睿频教程
linux·运维·服务器·性能优化
特种加菲猫5 小时前
指尖上的魔法:优雅高效的Linux命令手册
linux·笔记
★Orange★5 小时前
Linux Kernel kfifo 实现和巧妙设计
linux·运维·算法
bemyrunningdog6 小时前
Mock数据
linux·运维·ubuntu