Ask Your Question

Error compiling rosbag_storage on Mac OS X Yosemite

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

crazyorc gravatar image

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

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

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

crazyorc gravatar image

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

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 @@

+// Make sure that either __GLIBCXX__ or _LIBCPP_VERSION is defined.
+#include <cstddef>
 // C++ standard section 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


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

sallyw gravatar imagesallyw ( 2015-04-22 16:05:22 -0600 )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 imagecrazyorc ( 2015-04-22 19:28:32 -0600 )edit

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

veltrop gravatar imageveltrop ( 2015-05-07 22:45:04 -0600 )edit

@crazyorc can you open a pull request against

William gravatar imageWilliam ( 2015-05-20 16:13:01 -0600 )edit

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

William gravatar imageWilliam ( 2015-05-20 16:13:45 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


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

Seen: 988 times

Last updated: Apr 22 '15