Closed dirk-thomas closed 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.
The failure seems due to g++ language incompatibilities on Trusty.
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.
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.
Both functions (convert
and fromMsg
) are using each other. Do the following to resolve the compiler error:
convert
functions to be declarations onlyfromMsg
and toMsg
)Fixed by @mikepurvis with help from you, @dirk-thomas.
Thanks!
http://jenkins.ros.org/view/Idev/job/devel-indigo-geographic_info/ARCH_PARAM=amd64,UBUNTU_PARAM=trusty,label=devel/3/console