ROS/机器人开发实录

RoboRTS的安装

2018-06-22  本文已影响1人  松山剑客
  1. google protobuf版本问题:
/home/hitcsc/workspace/RoboRTS/modules/driver/camera/proto/camera_param.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is

#error This file was generated by a newer version of protoc which is

^

/home/hitcsc/workspace/RoboRTS/modules/driver/camera/proto/camera_param.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update

#error incompatible with your Protocol Buffer headers. Please update

^

/home/hitcsc/workspace/RoboRTS/modules/driver/camera/proto/camera_param.pb.h:14:2: error: #error your headers.

#error your headers.

^

In file included from /home/hitcsc/workspace/RoboRTS/modules/driver/camera/proto/camera_param.pb.cc:5:0:

/home/hitcsc/workspace/RoboRTS/modules/driver/camera/proto/camera_param.pb.h:23:35: fatal error: google/protobuf/arena.h: No such file or directory

compilation terminated.

错误包括两个:1). This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer headers. Please update your headers. 2). google/protobuf/arena.h: No such file or directory

按照网上博客的说法,产生错误的原因是使用的protoc软件版本不对,是用conda 安装对应版本的protoc就可以了,(但是并没有什么用,试过)在conda环境中指定安装了2.6.1版本的protoc,但是在终端中使用protoc --version 查看依然的是3.4.0,并不知道为什么。

protoc版本

博客里有说先用apt-get卸载libprotoc库,但是我看了一下,卸载这个库的话,ros-kinetic-desktop-full也会被卸载,看来libprotocros是绑定的了,那么能不能修改系统默认protoc呢?我猜在/usr/bin里直接修改链接地址是可以的,但是万一。。。ros以后要用。。。

最终的解决方法是:修改RoboRTSCMakeLists.txt文件,直接吧anaconda的包含文件夹加入。

include_directories(${CMAKE_SOURCE_DIR} ${catkin_INCLUDE_DIRS} /home/hitcsc/anaconda2/include)

2. 编译过程中对zlib的依赖问题

/home/hitcsc/anaconda2/lib/libpng16.so.16: undefined reference to `inflateValidate@ZLIB_1.2.9'

collect2: error: ld returned 1 exit status

查了一下发现是没有zliblibpng,好吧,这个其实是简单的部分,直接

anaconda search -t conda zlib

anaconda search -t conda libpng

找个合适的源然后安装就可以了。

上一篇 下一篇

猜你喜欢

热点阅读