Error with Boost scope

M. Dodson md403 at
Thu Jan 30 16:12:54 UTC 2020

*** I am hitting the mailing list with two questions because I’m not sure they’re sufficiently related to be in the same email.  Much of this information will be the identical between them, but the traces will be different.  ***

I am trying to build the simplest of demo applications from the Robot Operating System (ROS) on top of RTEMS.

I have a .c file (talker_init.c) that contains my Init function and a .cpp file (talker.cpp) that contains a function creating a ROS talker (just looping “hello world [counter value]”).  The Init function in the .c file calls the talker function in the .cpp file.

The ROS libraries rely on Boost libraries.  I think I’ve figured out how to get waf to find them (at least, that’s not where I appear to have problems).

My 'waf configure' command seems to complete without error.

When I 'waf build -v’, I get a slew of errors associated with things being out of scope for boost.  I’ve copied two such traces below.  I can build this just fine when I’m not cross-compiling for RTEMS.

I am using MacO Catalina 10.15.2 on a MacBook Pro.

I have added my own project directory within the rtems-examples repository and effectively copied a wscript file from another example project, so I’m still relying on the top-level wscript file and the additional elements in the rtems_waf directory.


examples $ ./waf build
Waf: Entering directory `/Users/michaeldodson/projects/rtems_root/examples/build/riscv-rtems5-rv64imac_medany'
[1/4] Compiling ros/talker/talker.cpp
[2/4] Compiling ros/talker/talker_init.c
In file included from ../../../../ros/melodic_catkin_ws/install_isolated/include/ros/assert.h:35,
                 from /usr/local/include/boost/assert.hpp:58,
                 from /usr/local/include/boost/math/policies/policy.hpp:21,
                 from /usr/local/include/boost/math/policies/error_handling.hpp:21,
                 from /usr/local/include/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/talker/talker.cpp:1:
../../../../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;
      |                             ^
In file included from /usr/local/include/boost/smart_ptr/shared_ptr.hpp:25,
                 from /usr/local/include/boost/shared_ptr.hpp:17,
                 from ../../../../ros/melodic_catkin_ws/install_isolated/include/ros/forwards.h:37,
                 from ../../../../ros/melodic_catkin_ws/install_isolated/include/ros/common.h:37,
                 from ../../../../ros/melodic_catkin_ws/install_isolated/include/ros/ros.h:43,
                 from ../../ros/talker/talker.cpp:1:
/usr/local/include/boost/smart_ptr/shared_ptr.hpp: In instantiation of 'typename boost::detail::sp_member_access<T>::type boost::shared_ptr<T>::operator->() const [with T = ros::Publisher::Impl; typename boost::detail::sp_member_access<T>::type = ros::Publisher::Impl*]':
../../../../ros/melodic_catkin_ws/install_isolated/include/ros/publisher.h:148:52:   required from here
/usr/local/include/boost/assert.hpp:60:35: error: 'assert' was not declared in this scope; did you mean 'mpl_::assert'?
   60 | # define BOOST_ASSERT(expr) assert(expr)
      |                             ~~~~~~^~~~~~
/usr/local/include/boost/smart_ptr/shared_ptr.hpp:734:9: note: in expansion of macro 'BOOST_ASSERT'
  734 |         BOOST_ASSERT( px != 0 );
      |         ^~~~~~~~~~~~
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list