Ask Your Question
1

Electric compile error in code that compiles with Diamondback: "rospack.h:195: error: ‘rospack_tinyxml’ has not been declared"

asked 2011-09-27 07:39:29 -0500

updated 2011-09-27 07:48:16 -0500

When compiling some packges that compile on diamondback I get the following set of compile errors:

  In file included from /home/somervil/Projects/rdk2project/stacks/re2rosUtil/re2_ros_util/include/re2_ros_util/Factory.h:30,
                   from /home/somervil/Projects/rdk2project/stacks/re2arm/re2_arm_driver/src/driver_common/Driver.cpp:27:
  /opt/ros/electric/ros/tools/rospack/include/rospack/rospack.h:195: error: ‘rospack_tinyxml’ has not been declared
  /opt/ros/electric/ros/tools/rospack/include/rospack/rospack.h:195: error: ISO C++ forbids declaration of ‘TiXmlElement’ with no type
  /opt/ros/electric/ros/tools/rospack/include/rospack/rospack.h:195: error: expected ‘;’ before ‘*’ token
  /opt/ros/electric/ros/tools/rospack/include/rospack/rospack.h:210: error: ‘rospack_tinyxml’ has not been declared
  /opt/ros/electric/ros/tools/rospack/include/rospack/rospack.h:210: error: ISO C++ forbids declaration of ‘TiXmlDocument’ with no type
  /opt/ros/electric/ros/tools/rospack/include/rospack/rospack.h:210: error: expected ‘;’ before ‘manifest’

I'll be answering this shortly myself. I'm just asking it for posterity, and to provide the solution to others.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2011-09-27 07:43:06 -0500

The problem is a conflicting include guard, TINYXML_INCLUDED, in rospack's custom tinyxml installation.

This has conflicted with other TINYXML implementations even in previous versions of ROS. This mostly went unnoticed because the implementations were compatible enough not to cause compile errors.

In electric tinyxml has been pushed into a namespace: "rospack_tinyxml" So now the conflict is exposed because either the types within the namespace will not be defined, or the types outside the namespace will not be defined depending on the include order.

There is a bug report here:

...so it may be soon fixed but in the mean time a work around would be:

just before an identified offending include file place:

#undef TINYXML_INCLUDED
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

Stats

Asked: 2011-09-27 07:39:29 -0500

Seen: 300 times

Last updated: Sep 27 '11