Compiling messages with libc++ - OSX 10.9
Hi,
In my next step for my quest to get ros to compile on OSX 10.9, I am stuck on compiling messages with libc++. Generating the messages works fine, but compiling with a ros message give me the following issue:
/opt/ros/hydro/install_isolated/include/std_msgs/String.h:67:68: error: implicit instantiation of undefined template 'std::allocator<void>'
typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _data_type;
^
/opt/ros/hydro/src/roscpp/src/libros/service_publication.cpp:139:24: note: in instantiation of template class 'std_msgs::String_<std::allocator<void> >' requested here
std_msgs::String error_string;
^
/opt/ros/hydro/install_isolated/include/ros/message_forward.h:33:28: note: template is declared here
template<typename T> class allocator;
^
In file included from /opt/ros/hydro/src/roscpp/src/libros/service_publication.cpp:42:
/opt/ros/hydro/install_isolated/include/std_msgs/String.h:67:97: error: 'rebind' following the 'template' keyword does not refer to a template
typedef std::basic_string<char, std::char_traits<char>, typename ContainerAllocator::template rebind<char>::other > _data_type;
^~~~~~
I believe the issue is that in libc++, using a forward declared class in a template is no longer compiling and gives an error instead. If I try to build it with libstdc++ instead, I get a chain reaction of other compile errors (ros::console, log4cxx, boost, xmlrpcpp, etc.). Anyone have an idea how to fix this?
Best regards, Hans
I removed all software and trying rebuild everything. But unfortunately c++11 is more strict and many warning became errors. Some of them errors are not really easy to resolve. I am currently stuck at compiling PCL again. Regarding your problem, haven't gotten there yet. Hope someone will know.
BTW, you are saying chain reaction, do you mean linking issues?
Yes, they are linking errors, but what I meant with chain reaction is that if I build it with libstdc++ instead, many other packages give me linking errors and I didn't manage to fix them all by compiling them too with libstdc++. I am trying to compile bare-bone at the moment, much easier (still hard)
Would you please describe how you solved the problem?