ros-geographic-info / geographic_info

ROS packages for geographic information
http://ros.org/wiki/geographic_info
66 stars 62 forks source link

devel job failing - compile error #12

Closed dirk-thomas closed 10 years ago

dirk-thomas commented 10 years ago

http://jenkins.ros.org/view/Idev/job/devel-indigo-geographic_info/ARCH_PARAM=amd64,UBUNTU_PARAM=trusty,label=devel/3/console

jack-oquin commented 10 years ago

I am working on this package now, trying to get it ready for an indigo release.

It currently fails some unit tests on Trusty.

jack-oquin commented 10 years ago

The failure seems due to g++ language incompatibilities on Trusty.

mikepurvis commented 10 years ago

I've reproduced the issue on my Trusty VM. The test context is:

      geodesy::UTMPoint pt1(e, n, alt, z, b);
      geographic_msgs::GeoPoint ll;
      convert(pt1, ll);
      geodesy::UTMPoint pt2;
      convert(ll, pt2);

Where the troublesome convert function is templated on both arguments:

  template <class From, class To>
  void convert(const From &from, To &to)
  {
    fromMsg(toMsg(from), to);
  }

The prototypes for UTMPoint -> GeoPoint are in utm.h. It seems odd to me that the compile insists the prototypes be defined in advance of convert function, or at least that's my interpretation of the "xxxx declared here, later in the translation unit" message. Doubly odd that this is something which has changed between GCC versions.

mikepurvis commented 10 years ago

Here it is, under "Name Lookup Changes": https://gcc.gnu.org/gcc-4.7/porting_to.html

I've fooled around with it for a bit, but I'm pretty stumped— short of adding -fpermissive, it seems like the only way to fix this would be a refactor that moves the convert functions out to a separate header which has to be included after all the toMsg/fromMsg functions you intend to use it with have already been declared.

I'm certain I'm not really understanding it, though.

dirk-thomas commented 10 years ago

Both functions (convert and fromMsg) are using each other. Do the following to resolve the compiler error:

jack-oquin commented 10 years ago

Fixed by @mikepurvis with help from you, @dirk-thomas.

Thanks!