ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Error compiling rosbag_storage on Mac OS X Yosemite

asked 2015-04-20 22:12:24 -0500

crazyorc gravatar image

updated 2015-04-22 19:34:47 -0500

I've been following the instructions on the ROS wiki for building on Mac OS X. I'm running 10.10.3 with Xcode 6.3 (with CLI tools 6.3 installed). Everything works until it tries to build rosbag_storage.

Building uncompressed_stream.cpp the following errors occur:

/usr/local/include/boost/format/format_fwd.hpp:24:69: error: no type named 'allocator' in namespace 'std'
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                               ~~~~~^
/usr/local/include/boost/format/format_fwd.hpp:24:78: error: expected ',' or '>' in template-parameter-list
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                             ^
/usr/local/include/boost/format/format_fwd.hpp:24:83: error: expected unqualified-id
        class Tr = BOOST_IO_STD char_traits<Ch>, class Alloc = std::allocator<Ch> >
                                                                                  ^
/usr/local/include/boost/format/format_fwd.hpp:27:13: error: unknown type name 'basic_format'
    typedef basic_format<char >     format;
            ^
/usr/local/include/boost/format/format_fwd.hpp:27:25: error: expected unqualified-id
    typedef basic_format<char >     format;
                        ^
/usr/local/include/boost/format/format_fwd.hpp:30:13: error: unknown type name 'basic_format'
    typedef basic_format<wchar_t >  wformat;
            ^
/usr/local/include/boost/format/format_fwd.hpp:30:25: error: expected unqualified-id
    typedef basic_format<wchar_t >  wformat;

Apparently my Google foo is not up to snuff as the only thing related to this has to do with a missing C++ std library file that is missing (<__debug>). Copying that file from Xcode into CLI tools doesn't fix the issue.

Any ideas how to get past this error?

EDIT: Same error with Xcode 6.3.1 (and matching CLI tools) installed

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2015-04-22 12:31:57 -0500

crazyorc gravatar image

updated 2015-04-22 19:25:59 -0500

The following patch fixes the issue (edit: use this patch instead to fix both roscpp and rosbag_storage).

--- src/roscpp_core/roscpp_traits/include/ros/message_forward.h.orig    2015-04-22 15:04:29.000000000 -0700
+++ src/roscpp_core/roscpp_traits/include/ros/message_forward.h 2015-04-22 15:46:31.000000000 -0700
@@ -28,6 +28,11 @@
 #ifndef ROSLIB_MESSAGE_FORWARD_H
 #define ROSLIB_MESSAGE_FORWARD_H

+// Make sure that either __GLIBCXX__ or _LIBCPP_VERSION is defined.
+#include <cstddef>
+
 // C++ standard section 17.4.3.1/1 states that forward declarations of STL types
 // that aren't specializations involving user defined types results in undefined
 // behavior. Apparently only libc++ has a problem with this and won't compile it.
edit flag offensive delete link more

Comments

Thanks! So far I've also needed to add that to src/ros_comm/roscpp/include/ros/rosout_appender.h

sallyw gravatar image sallyw  ( 2015-04-22 16:05:22 -0500 )edit

The problem appears to be that roscpp and rosbag_storage include message_forward.h but haven't included any C++ stdlib include files which would cause __GLIBCXX__ or _LIBCPP_VERSION to be defined. Edited solution patch to include a better fix.

crazyorc gravatar image crazyorc  ( 2015-04-22 19:28:32 -0500 )edit

Thanks! This solution worked for me. I've added it to the troubleshooting section of the OSX install wiki.

veltrop gravatar image veltrop  ( 2015-05-07 22:45:04 -0500 )edit

@crazyorc can you open a pull request against https://github.com/ros/roscpp_core/pu...

William gravatar image William  ( 2015-05-20 16:13:01 -0500 )edit

Disregard, I just saw that you have already done so. Sorry about that.

William gravatar image William  ( 2015-05-20 16:13:45 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-04-20 22:12:24 -0500

Seen: 1,316 times

Last updated: Apr 22 '15