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.

相关推荐
陌路203 小时前
Linux18--进程间的通信总结
linux
2401_858286113 小时前
OS36.【Linux】简单理解EXT2文件系统(2)
linux·运维·服务器·数据结构·文件系统·ext2
Zach_yuan3 小时前
程序地址空间
android·linux·运维·服务器
梁萌3 小时前
Linux安装BiliNote
linux·运维·服务器·docker·bilinote
小安运维日记4 小时前
RHCA - DO374 | Day03:通过自动化控制器运行剧本
linux·运维·数据库·自动化·ansible·1024程序员节
乐十九5 小时前
IIC总线原理详解
linux
mi20066 小时前
银河麒麟v10 sp1更改data目录挂载
linux·运维
tan180°6 小时前
Linux网络HTTP(下)(9)
linux·网络·http
半路_出家ren7 小时前
设计一个学生管理系统的数据库
linux·数据库·sql·mysql·网络安全·数据库管理员
着迷不白7 小时前
华为堡垒机
linux·运维·服务器·centos