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.

相关推荐
光电的一只菜鸡3 小时前
ubuntu之坑(二十)——VMware虚拟机系统无法正常进入如何处理
linux·运维·ubuntu
你住过的屋檐4 小时前
【Nginx】linux上安装nginx
linux·运维·nginx
宵时待雨5 小时前
linux笔记归纳17:传输层协议UDP
linux·笔记·udp
SCandL1526 小时前
k8s service
linux·容器·kubernetes
会飞的土拨鼠呀7 小时前
Linux的存储使用率应该如何计算
linux·运维·服务器
weixin_511255219 小时前
NGINX常用配置
linux·服务器·nginx
昌原的儿子LEO10 小时前
进程和线程(2)
linux·服务器·网络
会飞的土拨鼠呀10 小时前
Linux 真实内存使用率的核心计算标准
linux·运维·服务器
陈年老古董11 小时前
CentOS编译安装Python3.11完整教程
linux·笔记·学习·centos·python3.11
深念Y11 小时前
为什么选 Go:直观、可维护、AI 友好
linux·开发语言·人工智能·golang·agent·harness