Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devel job failing - compile error #12

Closed
dirk-thomas opened this issue Jul 30, 2014 · 6 comments
Closed

devel job failing - compile error #12

dirk-thomas opened this issue Jul 30, 2014 · 6 comments

Comments

@dirk-thomas
Copy link

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

@jack-oquin
Copy link
Member

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
Copy link
Member

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

@mikepurvis
Copy link
Member

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
Copy link
Member

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
Copy link
Author

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

  • change the two templated convert functions to be declarations only
  • move the definition of these to the end of the file (at least behind the definition of fromMsg and toMsg)

jack-oquin added a commit that referenced this issue Aug 30, 2014
…lation

Fix for compilation bug on GCC 4.7+, ticket #12
@jack-oquin
Copy link
Member

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

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants