catkin_make的时候出现错误,“tf未定义的引用collect2: error: ld returned 1 exit status”求助!!!

NarutoKAKA 2019-06-28 03:43:58
[ 18%] Linking CXX executable /home/robot/catkin_ws/devel/lib/lio/lio_map_builder_node
/home/robot/catkin_ws/devel/lib/liblio-map-builder.so:对‘tf::TransformBroadcaster::sendTransform(tf::StampedTransform const&)’未定义的引用
/home/robot/catkin_ws/devel/lib/liblio-point-processor.so:对‘tf::TransformBroadcaster::TransformBroadcaster()’未定义的引用
collect2: error: ld returned 1 exit status
make[2]: *** [/home/robot/catkin_ws/devel/lib/lio/lio_map_builder_node] 错误 1
make[1]: *** [lio-mapping-master/CMakeFiles/lio_map_builder_node.dir/all] 错误 2
make: *** [all] 错误 2
Invoking "make -lpthread -j1 -l1" failed
...全文
989 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_43049265 2021-11-16
  • 打赏
  • 举报
回复

我也是这个问题

NarutoKAKA 2019-06-28
  • 打赏
  • 举报
回复
CMakeError.log是这样的 Determining if the pthread_create exist failed with the following output: Change Dir: /home/robot/catkin_ws/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_e34e3/fast /usr/bin/make -f CMakeFiles/cmTC_e34e3.dir/build.make CMakeFiles/cmTC_e34e3.dir/build make[1]: 正在进入目录 `/home/robot/catkin_ws/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_e34e3.dir/CheckSymbolExists.c.o /usr/bin/cc -o CMakeFiles/cmTC_e34e3.dir/CheckSymbolExists.c.o -c /home/robot/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c Linking C executable cmTC_e34e3 /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e34e3.dir/link.txt --verbose=1 /usr/bin/cc -rdynamic CMakeFiles/cmTC_e34e3.dir/CheckSymbolExists.c.o -o cmTC_e34e3 CMakeFiles/cmTC_e34e3.dir/CheckSymbolExists.c.o:在函数‘main’中: CheckSymbolExists.c:(.text+0x16):对‘pthread_create’未定义的引用 collect2: error: ld returned 1 exit status make[1]: *** [cmTC_e34e3] 错误 1 make[1]:正在离开目录 `/home/robot/catkin_ws/build/CMakeFiles/CMakeTmp' make: *** [cmTC_e34e3/fast] 错误 2 File /home/robot/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c: /* */ #include <pthread.h> int main(int argc, char** argv) { (void)argv; #ifndef pthread_create return ((int*)(&pthread_create))[argc]; #else (void)argc; return 0; #endif } Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: /home/robot/catkin_ws/build/CMakeFiles/CMakeTmp Run Build Command(s):/usr/bin/make cmTC_5bfcb/fast /usr/bin/make -f CMakeFiles/cmTC_5bfcb.dir/build.make CMakeFiles/cmTC_5bfcb.dir/build make[1]: 正在进入目录 `/home/robot/catkin_ws/build/CMakeFiles/CMakeTmp' Building C object CMakeFiles/cmTC_5bfcb.dir/CheckFunctionExists.c.o /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_5bfcb.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.14/Modules/CheckFunctionExists.c Linking C executable cmTC_5bfcb /usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5bfcb.dir/link.txt --verbose=1 /usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_5bfcb.dir/CheckFunctionExists.c.o -o cmTC_5bfcb -lpthreads /usr/bin/ld: 找不到 -lpthreads collect2: error: ld returned 1 exit status make[1]: *** [cmTC_5bfcb] 错误 1 make[1]:正在离开目录 `/home/robot/catkin_ws/build/CMakeFiles/CMakeTmp' make: *** [cmTC_5bfcb/fast] 错误 2

64,654

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧