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.

相关推荐
思麟呀1 小时前
Linux的基础IO流
linux·运维·服务器·开发语言·c++
winner88812 小时前
嵌入式Linux驱动开发全流程:工具协作+核心概念拆解(从入门到理解)
linux·运维·驱动开发
ShiinaKaze2 小时前
fatal error: bits/c++config.h: No such file or directory
linux·gcc·g++
Archy_Wang_12 小时前
脚本自动生成专业Linux巡检报告
linux·运维·服务器
java_logo3 小时前
SGLANG Docker容器化部署指南
linux·运维·docker·容器·eureka·1024程序员节
敲代码的瓦龙4 小时前
操作系统?进程!!!
linux·c++·操作系统
打不了嗝 ᥬ᭄4 小时前
数据链路层
linux·网络·网络协议·http
piaoxue8204 小时前
MFA MACOS 安装流程
linux·运维·服务器
鱼干~6 小时前
electron基础
linux·javascript·electron
apocelipes6 小时前
POSIX兼容系统上read和write系统调用的行为总结
linux·c语言·c++·python·golang·linux编程