本文主要是介绍compile turtlebot3_gazebo error,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
自己无意中重新安装了其他版本的protobuf,出现以下错误:
/usr/local/include/google/protobuf/arenastring.h:225:31: note: candidate expects 0 arguments, 1 provided
In file included from /usr/include/gazebo-9/gazebo/msgs/MessageTypes.hh:132,from /usr/include/gazebo-9/gazebo/msgs/msgs.hh:35,from /usr/include/gazebo-9/gazebo/physics/Entity.hh:28,from /usr/include/gazebo-9/gazebo/physics/Model.hh:30,from /usr/include/gazebo-9/gazebo/physics/Actor.hh:26,from /usr/include/gazebo-9/gazebo/physics/physics.hh:2,from /home/bartosz/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/include/gazebo_plugins/gazebo_ros_utils.h:40,from /home/bartosz/catkin_ws/src/gazebo_ros_pkgs/gazebo_plugins/src/gazebo_ros_utils.cpp:35:
/usr/include/gazebo-9/gazebo/msgs/world_modify.pb.h: In member function ‘const string& gazebo::msgs::WorldModify::cloned_uri() const’:
/usr/include/gazebo-9/gazebo/msgs/world_modify.pb.h:339:93: error: no matching function for call to ‘google::protobuf::internal::ArenaStringPtr::GetNoArena(const string*) const’return cloned_uri_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
解决办法就是重新安装protobuf,先删除,再重新安装。
删除:
sudo rm -rf /usr/local/bin/protoc /usr/local/include/google /usr/local/lib/libproto*
安装:
git clone https://github.com/google/protobuf.git && cd protobuf && ./configure && make && make check && sudo make install
补充:
后来又出现类似的错误,由于太长就贴在文章最后吧。以上方法行不通了,又尝试了一会才行。
解决办法是先删除现有的版本,再重新安装系统默认版本的protobuf,还有gazebo和msg:
sudo rm -rf /usr/local/bin/protoc /usr/local/include/google /usr/local/lib/libproto*
sudo apt reinstall libprotobuf-dev libignition-msgs* ros-foxy-gazebo-dev
错误如下:
In file included from /usr/include/ignition/msgs5/ignition/msgs/MessageTypes.hh:196,from /usr/include/ignition/msgs5/ignition/msgs/Utility.hh:33,from /usr/include/ignition/msgs5/ignition/msgs.hh:27,from /usr/include/ignition/transport8/ignition/transport/Node.hh:33,from /usr/include/gazebo-11/gazebo/physics/Entity.hh:25,from /usr/include/gazebo-11/gazebo/physics/Model.hh:30,from /usr/include/gazebo-11/gazebo/physics/Actor.hh:27,from /usr/include/gazebo-11/gazebo/physics/physics.hh:2,from /home/shanph/Documents/local/ros2_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc:22:
/usr/include/ignition/msgs5/ignition/msgs/wireless_nodes.pb.h: At global scope:
/usr/include/ignition/msgs5/ignition/msgs/wireless_nodes.pb.h:53:46: error: ‘AuxillaryParseTableField’ in namespace ‘google::protobuf::internal’ does not name a type; did you mean ‘AuxiliaryParseTableField’?53 | static const ::google::protobuf::internal::AuxillaryParseTableField aux[];| ^~~~~~~~~~~~~~~~~~~~~~~~| AuxiliaryParseTableField
In file included from /usr/include/ignition/msgs5/ignition/msgs/MessageTypes.hh:196,from /usr/include/ignition/msgs5/ignition/msgs/Utility.hh:33,from /usr/include/ignition/msgs5/ignition/msgs.hh:27,from /usr/include/ignition/transport8/ignition/transport/Node.hh:33,from /usr/include/gazebo-11/gazebo/physics/Entity.hh:25,from /usr/include/gazebo-11/gazebo/physics/Model.hh:30,from /usr/include/gazebo-11/gazebo/physics/Actor.hh:27,from /usr/include/gazebo-11/gazebo/physics/physics.hh:2,from /home/shanph/Documents/local/ros2_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc:22:
/usr/include/ignition/msgs5/ignition/msgs/wireless_nodes.pb.h:192:33: error: ‘InternalMetadataWithArena’ in namespace ‘google::protobuf::internal’ does not name a type; did you mean ‘InternalMetadata’?192 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;| ^~~~~~~~~~~~~~~~~~~~~~~~~| InternalMetadata
/usr/include/ignition/msgs5/ignition/msgs/wireless_nodes.pb.h:137:8: error: ‘bool ignition::msgs::WirelessNodes::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)’ marked ‘final’, but is not virtual137 | bool MergePartialFromCodedStream(| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ignition/msgs5/ignition/msgs/wireless_nodes.pb.h:139:8: error: ‘void ignition::msgs::WirelessNodes::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const’ marked ‘final’, but is not virtual139 | void SerializeWithCachedSizes(| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ignition/msgs5/ignition/msgs/wireless_nodes.pb.h:141:30: error: ‘google::protobuf::uint8* ignition::msgs::WirelessNodes::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’ marked ‘final’, but is not virtual141 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/ignition/msgs5/ignition/msgs/MessageTypes.hh:198,from /usr/include/ignition/msgs5/ignition/msgs/Utility.hh:33,from /usr/include/ignition/msgs5/ignition/msgs.hh:27,from /usr/include/ignition/transport8/ignition/transport/Node.hh:33,from /usr/include/gazebo-11/gazebo/physics/Entity.hh:25,from /usr/include/gazebo-11/gazebo/physics/Model.hh:30,from /usr/include/gazebo-11/gazebo/physics/Actor.hh:27,from /usr/include/gazebo-11/gazebo/physics/physics.hh:2,from /home/shanph/Documents/local/ros2_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc:22:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:52:46: error: ‘AuxillaryParseTableField’ in namespace ‘google::protobuf::internal’ does not name a type; did you mean ‘AuxiliaryParseTableField’?52 | static const ::google::protobuf::internal::AuxillaryParseTableField aux[];| ^~~~~~~~~~~~~~~~~~~~~~~~| AuxiliaryParseTableField
In file included from /usr/include/ignition/msgs5/ignition/msgs/MessageTypes.hh:198,from /usr/include/ignition/msgs5/ignition/msgs/Utility.hh:33,from /usr/include/ignition/msgs5/ignition/msgs.hh:27,from /usr/include/ignition/transport8/ignition/transport/Node.hh:33,from /usr/include/gazebo-11/gazebo/physics/Entity.hh:25,from /usr/include/gazebo-11/gazebo/physics/Model.hh:30,from /usr/include/gazebo-11/gazebo/physics/Actor.hh:27,from /usr/include/gazebo-11/gazebo/physics/physics.hh:2,from /home/shanph/Documents/local/ros2_ws/src/turtlebot3/turtlebot3_simulations/turtlebot3_gazebo/models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc:22:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:225:33: error: ‘InternalMetadataWithArena’ in namespace ‘google::protobuf::internal’ does not name a type; did you mean ‘InternalMetadata’?225 | ::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;| ^~~~~~~~~~~~~~~~~~~~~~~~~| InternalMetadata
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:136:8: error: ‘bool ignition::msgs::WorldModify::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)’ marked ‘final’, but is not virtual136 | bool MergePartialFromCodedStream(| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:138:8: error: ‘void ignition::msgs::WorldModify::SerializeWithCachedSizes(google::protobuf::io::CodedOutputStream*) const’ marked ‘final’, but is not virtual138 | void SerializeWithCachedSizes(| ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:140:30: error: ‘google::protobuf::uint8* ignition::msgs::WorldModify::InternalSerializeWithCachedSizesToArray(bool, google::protobuf::uint8*) const’ marked ‘final’, but is not virtual140 | ::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::clear_world_name()’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:296:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘ClearToEmptyNoArena’; did you mean ‘ClearToEmpty’?296 | world_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());| ^~~~~~~~~~~~~~~~~~~| ClearToEmpty
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘const string& ignition::msgs::WorldModify::world_name() const’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:300:22: error: ‘const struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘GetNoArena’; did you mean ‘DestroyNoArena’?300 | return world_name_.GetNoArena();| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_world_name(const string&)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:304:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?304 | world_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_world_name(std::string&&)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:310:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?310 | world_name_.SetNoArena(| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_world_name(const char*)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:318:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?318 | world_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_world_name(const char*, size_t)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:323:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?323 | world_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘std::string* ignition::msgs::WorldModify::mutable_world_name()’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:330:22: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘MutableNoArena’330 | return world_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());| ^~~~~~~~~~~~~~
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘std::string* ignition::msgs::WorldModify::release_world_name()’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:335:22: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘ReleaseNoArena’; did you mean ‘ReleaseNonDefault’?335 | return world_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());| ^~~~~~~~~~~~~~| ReleaseNonDefault
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_allocated_world_name(std::string*)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:343:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetAllocatedNoArena’; did you mean ‘SetAllocated’?343 | world_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), world_name);| ^~~~~~~~~~~~~~~~~~~| SetAllocated
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::clear_cloned_uri()’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:391:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘ClearToEmptyNoArena’; did you mean ‘ClearToEmpty’?391 | cloned_uri_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());| ^~~~~~~~~~~~~~~~~~~| ClearToEmpty
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘const string& ignition::msgs::WorldModify::cloned_uri() const’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:395:22: error: ‘const struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘GetNoArena’; did you mean ‘DestroyNoArena’?395 | return cloned_uri_.GetNoArena();| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_cloned_uri(const string&)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:399:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?399 | cloned_uri_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_cloned_uri(std::string&&)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:405:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?405 | cloned_uri_.SetNoArena(| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_cloned_uri(const char*)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:413:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?413 | cloned_uri_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_cloned_uri(const char*, size_t)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:418:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetNoArena’; did you mean ‘DestroyNoArena’?418 | cloned_uri_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),| ^~~~~~~~~~| DestroyNoArena
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘std::string* ignition::msgs::WorldModify::mutable_cloned_uri()’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:425:22: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘MutableNoArena’425 | return cloned_uri_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());| ^~~~~~~~~~~~~~
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘std::string* ignition::msgs::WorldModify::release_cloned_uri()’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:430:22: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘ReleaseNoArena’; did you mean ‘ReleaseNonDefault’?430 | return cloned_uri_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());| ^~~~~~~~~~~~~~| ReleaseNonDefault
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h: In member function ‘void ignition::msgs::WorldModify::set_allocated_cloned_uri(std::string*)’:
/usr/include/ignition/msgs5/ignition/msgs/world_modify.pb.h:438:15: error: ‘struct google::protobuf::internal::ArenaStringPtr’ has no member named ‘SetAllocatedNoArena’; did you mean ‘SetAllocated’?438 | cloned_uri_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), cloned_uri);| ^~~~~~~~~~~~~~~~~~~| SetAllocated
make[2]: *** [CMakeFiles/obstacle1.dir/build.make:63: CMakeFiles/obstacle1.dir/models/turtlebot3_dqn_world/obstacle_plugin/obstacle1.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/obstacle1.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make[2]: *** [CMakeFiles/obstacles.dir/build.make:63: CMakeFiles/obstacles.dir/models/turtlebot3_dqn_world/obstacle_plugin/obstacles.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/obstacles.dir/all] Error 2
make[2]: *** [CMakeFiles/obstacle2.dir/build.make:63: CMakeFiles/obstacle2.dir/models/turtlebot3_dqn_world/obstacle_plugin/obstacle2.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/obstacle2.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
这篇关于compile turtlebot3_gazebo error的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!