ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Diamondback's image_transport fails to compile, how come?

asked 2011-08-17 21:19:53 -0600

Julius gravatar image

updated 2014-01-28 17:10:14 -0600

ngrennan gravatar image

I am compiling ROS Diamondback from source, following the instructions at Most of the packages, especially core ones like roscpp compile without any problems, but when compiling image_transport via

rosmake image_transport

I receive the following error, where

  [ 10%] Building CXX object CMakeFiles/image_transport.dir/src/publisher.o
  In file included from /usr/include/boost/ptr_container/detail/reversible_ptr_container.hpp:24:0,
                   from /usr/include/boost/ptr_container/ptr_sequence_adapter.hpp:20,
                   from /usr/include/boost/ptr_container/ptr_vector.hpp:20,
                   from /opt/ros/diamondback/image_common/image_transport/src/publisher.cpp:38:
[...] lots of other compiler error output [...]
 /opt/ros/diamondback/image_common/image_transport/src/publisher.cpp:59:5:   instantiated from here
  /usr/include/boost/ptr_container/clone_allocator.hpp:34:27: error: cannot allocate an object of abstract type ‘image_transport::PublisherPlugin’
  /opt/ros/diamondback/image_common/image_transport/include/image_transport/publisher_plugin.h:13:7: note:   because the following virtual functions are pure within ‘image_transport::PublisherPlugin’:
  /opt/ros/diamondback/image_common/image_transport/include/image_transport/publisher_plugin.h:22:23: note:     virtual std::string image_transport::PublisherPlugin::getTransportName() const
  /opt/ros/diamondback/image_common/image_transport/include/image_transport/publisher_plugin.h:49:20: note:     virtual uint32_t image_transport::PublisherPlugin::getNumSubscribers() const
  /opt/ros/diamondback/image_common/image_transport/include/image_transport/publisher_plugin.h:54:23: note:     virtual std::string image_transport::PublisherPlugin::getTopic() const
  /opt/ros/diamondback/image_common/image_transport/include/image_transport/publisher_plugin.h:59:16: note:     virtual void image_transport::PublisherPlugin::publish(const Image&) const
  /opt/ros/diamondback/image_common/image_transport/include/image_transport/publisher_plugin.h:72:16: note:     virtual void image_transport::PublisherPlugin::shutdown()
  /opt/ros/diamondback/image_common/image_transport/include/image_transport/publisher_plugin.h:87:16: note:     virtual void image_transport::PublisherPlugin::advertiseImpl(ros::NodeHandle&, const string&, uint32_t, const SubscriberStatusCallback&, const SubscriberStatusCallback&, const VoidPtr&, bool)
  make[3]: *** [CMakeFiles/image_transport.dir/src/publisher.o] Error 1
  make[3]: Leaving directory `/opt/ros/diamondback/image_common/image_transport/build'
  make[2]: *** [CMakeFiles/image_transport.dir/all] Error 2
  make[2]: Leaving directory `/opt/ros/diamondback/image_common/image_transport/build'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `/opt/ros/diamondback/image_common/image_transport/build'
[ rosmake ] Output from build of package image_transport written to:

The compiler doesn't like line 59 in image_transport/src/publishers.cpp

 56   uint32_t getNumSubscribers() const
 57   {
 58     uint32_t count = 0;
 59     BOOST_FOREACH(const PublisherPlugin& pub, publishers_)
 60       count += pub.getNumSubscribers();
 61     return count;
 62   }

This very much seems like some piece of code trying to instantiate an abstract class that contains pure virtual methods (=0). Yet, I expect Diamondback's source tag to compile and be consistent. Is it possible that this is symptom of an incompatibility of ROS diamondback with a certain Boost version?

edit retag flag offensive close merge delete


What version of Boost are you using? Our target platforms are specified in For Diamondback we expect 1.40, but I'd expect at least as far back as 1.37 (C Turtle) to work.
Patrick Mihelich gravatar image Patrick Mihelich  ( 2011-08-18 10:45:02 -0600 )edit
I am using boost version 1.47.0-1. I might try to use version 1.40 then, thanks! If that doesn't work out, of course, I'll move to Ubuntu for ROS development. I am fully aware that Arch support is experimental.
Julius gravatar image Julius  ( 2011-08-18 18:53:15 -0600 )edit

2 Answers

Sort by » oldest newest most voted

answered 2011-08-18 19:29:42 -0600

Julius gravatar image

ROS Diamondback's pluginlib (image_transport depends on pluginlib) compiles with Boost 1.43,0-1 but not with Boost 1.47.01 on Arch. Use Arch Rollback Machine to downgrade to older version of Boost to solve this issue (thanks Patrick for this link:

edit flag offensive delete link more

answered 2011-10-10 03:20:13 -0600

gleechinese gravatar image

I got it to compile by changing the offending BOOST_FOREACH into a regular for loop.

for ( uint32_t i = 0 ; i < publishers_.size() ; i++ )
    count += publishers_[i].getNumSubscribers() ;

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-08-17 21:19:53 -0600

Seen: 668 times

Last updated: Oct 10 '11