Error with Boost scope

M. Dodson md403 at cam.ac.uk
Tue Feb 4 17:01:20 UTC 2020



On 4 Feb 2020, at 16:41, Sebastian Huber <sebastian.huber at embedded-brains.de<mailto:sebastian.huber at embedded-brains.de>> wrote:

On 04/02/2020 14:37, M. Dodson wrote:

Specifically, my waf has:

includes = [
...
'/Users/michaeldodson/projects/rtems_root/boost_1_72_0',
'/usr/local/include’]

It seems to be finding the header files just fine, as the errors are associated with a declaration within the header that isn’t in scope.

You should not use standard installation paths of your host system for header files of the RTEMS target. This may accidentally pull in undesired header files.

I’m possibly misunderstanding your statement:

I was only including '/Users/michaeldodson/projects/rtems_root/boost_1_72_0’ (the location of the Boost libraries built with the RTEMS cross-compilation tools.  The errors I reported were based on a build only using that include path.

In your first email there are also /usr/local/include paths in the log.



Yes, sorry.  After the first email Chris asked me if I’d actually built Boost with the RTEMS tools, which I hadn’t.  So I did that and then added the new trace (which was basically the same, but with different paths to the Boost libraries) to the thread.  I should have been clearer….

Do you have an example code which triggers the issue?


Sure, but it’s not even getting past the #include statements, I think.

The file is copied below.  You can find ros.h (the first header file in the traces I copied) here:

https://github.com/ros/ros_comm/blob/melodic-devel/clients/roscpp/include/ros/ros.h

The main function in this file is called from a separate file that only contains an RTEMS Init() function.

#include "ros/ros.h"
#include "std_msgs/String.h"

void chatterCallback(const std_msgs::String::ConstPtr& msg);
int main(int argc, char **argv);

void chatterCallback(const std_msgs::String::ConstPtr& msg)
{
  ROS_INFO("I heard: [%s]", msg->data.c_str());
}

int main(int argc, char **argv)
{
  ros::init(argc, argv, "listener");

  ros::NodeHandle n;

  ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);

  ros::spin();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20200204/8f6780df/attachment-0001.html>


More information about the users mailing list