Closed hgaiser closed 10 years ago
Removing the forward declaration also solved the problem for me with clang/libc++ on Mavericks. Why is that even needed? Compilation speed up? In any case I am pretty sure adding declarations to namespace std is undefined behaviour (C++ std 17.4.3.1/1), unless they are template specializations.
The header file uses it later (https://github.com/hgaiser/roscpp_core/blob/573448adf6f5ac64611c17d3933345c7367c360f/roscpp_traits/include/ros/message_forward.h#L54) and since it does not import anything it must have a forward declaration for the type.
Can you please post the error message you are getting?
Here is a gist of the error: https://gist.github.com/jensenb/30563a884c1c76eeb401 . It occurs in the dependent package eigen_conversions. Maybe the include <memory>
is missing?
I did some more research into the issue, and although forward declaring STL stuff is undefined behaviour, only libc++ has a problem with it. The Boost guys also ran into similar issues, and they solved it by conditionally including the appropriate headers on libc++ systems, and using their forward declarations on systems where this was not a problem. That would something like e4dff32c8847f7e9e16b3aecebbbbaf7d84daf5a.
Have you been able to understand the error on libc++ systems?
Fixes with a preprocessor conditional as mentioned in e4dff32c8847f7e9e16b3aecebbbbaf7d84daf5a.
Should this commit, https://github.com/ros/roscpp_core/commit/e4dff32c8847f7e9e16b3aecebbbbaf7d84daf5a, be back ported to Groovy? I still get this compile error when building Groovy on Mavericks.
Yes most likely, actually to any ros distro that has this.
I also think so.
Done in fb997090a6d58f2b01000cc4552f659c08e61c5e
Thanks.
I am not sure why this is in message_forward.h, but when compiling on OSX 10.9 with libc++ this causes an error when compiling with generated messages.
Not sure this is the proper fix, but it worked for me.