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

Boost errors with ros/console.h

asked 2020-02-04 06:39:40 -0500

broomstick gravatar image

updated 2020-02-04 07:16:31 -0500

gvdhoorn gravatar image

I'm building a simple talker/listener demo and I'm trying to cross-compile to a real-time operating system called RTEMS.

During compilation, I get the following error associated with ros/console.h, included from ros/assert.h:

In file included from ../../../../ros/melodic_catkin_ws/install_isolated/include/ros/assert.h:35,
                 from ../../../boost_1_72_0/boost/assert.hpp:58,
                 from ../../../boost_1_72_0/boost/math/policies/policy.hpp:21,
                 from ../../../boost_1_72_0/boost/math/policies/error_handling.hpp:21,
                 from ../../../boost_1_72_0/boost/math/special_functions/round.hpp:14,
                 from ../../../../ros/melodic_catkin_ws/install_isolated/include/ros/time.h:58,
                 from ../../../../ros/melodic_catkin_ws/install_isolated/include/ros/ros.h:38,
                 from ../../ros/listener/listener.cpp:3:
../../../../ros/melodic_catkin_ws/install_isolated/include/ros/console.h:126:16: error: 'shared_ptr' in namespace 'boost' does not name a template type; did you mean 'shared_array'?
  126 | typedef boost::shared_ptr<Token> TokenPtr;
      |                ^~~~~~~~~~
      |                shared_array
../../../../ros/melodic_catkin_ws/install_isolated/include/ros/console.h:127:21: error: 'TokenPtr' was not declared in this scope; did you mean 'Token'?
  127 | typedef std::vector<TokenPtr> V_Token;
      |                     ^~~~~~~~
      |                     Token
../../../../ros/melodic_catkin_ws/install_isolated/include/ros/console.h:127:29: error: template argument 1 is invalid
  127 | typedef std::vector<TokenPtr> V_Token;
      |                             ^
../../../../ros/melodic_catkin_ws/install_isolated/include/ros/console.h:127:29: error: template argument 2 is invalid

I thought this might be a problem with using the Boost installed from my package manager, so I installed it from source. In any case, the Boost files appear to be the 'header-only' libraries, which don't require platform-specific compilation.

I've built this just fine when I'm not cross-compiling, so presumably it's not primarily a ROS problem, but I was hoping someone might be able to give me some hints as to what's happening so I can fix whatever's going on with my cross-compilation.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-16 01:31:43 -0500

doodleshr gravatar image

try mannualy add #include <boost shared_ptr.hpp=""> to the file where error happens.

edit flag offensive delete link more


Thanks. I don't have this toolchain set up at the moment, but I'll test it when I spin it back up and accept (or provide more error output...).

broomstick gravatar image broomstick  ( 2020-09-17 09:46:39 -0500 )edit

Your Answer

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

Add Answer

Question Tools



Asked: 2020-02-04 06:39:40 -0500

Seen: 268 times

Last updated: Sep 16 '20