Error with Boost scope

M. Dodson md403 at
Fri Jan 31 11:59:01 UTC 2020

On 30 Jan 2020, at 22:46, Chris Johns <chrisj at<mailto:chrisj at>> wrote:

On 31/1/20 3:12 am, M. Dodson wrote:
*** 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
[1/4] Compiling ros/talker/talker.cpp
[2/4] Compiling ros/talker/talker_init.c
In file included from
                 from /usr/local/include/boost/assert.hpp:58,

This looks like a host file and not and RTEMS. Do you have an RTEMS build of
boost installed somewhere?

Nope!  Seems like a pretty fundamental problem.

I’ll try it and report back.

Has it been done?  Any tips/tricks/pointers/pitfalls?



                 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/talker/talker.cpp:1:
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
error: 'TokenPtr' was not declared in this scope; did you mean 'Token'?
  127 | typedef std::vector<TokenPtr> V_Token;
      |                     ^~~~~~~~
      |                     Token
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/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*]':
  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
  734 |         BOOST_ASSERT( px != 0 );
      |         ^~~~~~~~~~~~

users mailing list
users at<mailto:users at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list