Failed to compile ros2/examples in OS X

asked 2018-10-15 03:06:41 -0600

jihoonl gravatar image

updated 2018-10-15 05:04:23 -0600

gvdhoorn gravatar image

Hello there,

I am failing to compile ros2/examples after fresh install in os X version 10.13.

Can anyone guide me what I am missing? I have a binary installation base by following this instruction.

jihoonl@MacBook-Pro:~/work/ros2/mine/src/examples$ colcon build
Starting >>> examples_rclcpp_minimal_client
Starting >>> examples_rclcpp_minimal_composition
Starting >>> examples_rclcpp_minimal_publisher
Starting >>> examples_rclcpp_minimal_service
Starting >>> examples_rclcpp_minimal_subscriber
Starting >>> examples_rclcpp_minimal_timer
Starting >>> examples_rclpy_executors
Starting >>> examples_rclpy_minimal_client
Starting >>> examples_rclpy_minimal_publisher
Starting >>> examples_rclpy_minimal_service
Starting >>> examples_rclpy_minimal_subscriber
Finished <<< examples_rclpy_executors [2.83s]
Finished <<< examples_rclpy_minimal_client [2.80s]
Finished <<< examples_rclpy_minimal_publisher [2.78s]
Finished <<< examples_rclpy_minimal_service [2.84s]
Finished <<< examples_rclpy_minimal_subscriber [2.93s]
--- stderr: examples_rclcpp_minimal_client
In file included from /Users/jihoonl/work/ros2/mine/src/examples/rclcpp/minimal_client/main.cpp:19:
In file included from /Users/jihoonl/work/ros2/base/include/rclcpp/rclcpp.hpp:144:
In file included from /Users/jihoonl/work/ros2/base/include/rclcpp/executors.hpp:18:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/future:370:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/mutex:191:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__mutex_base:17:
/Library/Developer/CommandLineTools/usr/include/c++/v1/__threading_support:374:44: error: use of undeclared identifier 'errno'
   while (nanosleep(&__ts, &__ts) == -1 && errno == EINTR);
                                           ^
In file included from /Users/jihoonl/work/ros2/mine/src/examples/rclcpp/minimal_client/main.cpp:19:
In file included from /Users/jihoonl/work/ros2/base/include/rclcpp/rclcpp.hpp:144:
In file included from /Users/jihoonl/work/ros2/base/include/rclcpp/executors.hpp:21:
In file included from /Users/jihoonl/work/ros2/base/include/rclcpp/executors/multi_threaded_executor.hpp:24:
In file included from /Users/jihoonl/work/ros2/base/include/rclcpp/executor.hpp:22:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:40:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/istream:163:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/ostream:140:
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:736:44: error: use of undeclared identifier 'errno'
        typename remove_reference<decltype(errno)>::type __save_errno = errno;
                                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:736:53: error: no type named 'type' in the global namespace
        typename remove_reference<decltype(errno)>::type __save_errno = errno;
                                                  ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:736:73: error: use of undeclared identifier 'errno'
        typename remove_reference<decltype(errno)>::type __save_errno = errno;
                                                                        ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:737:9: error: use of undeclared identifier 'errno'
        errno = 0;
        ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:740:44: error: use of undeclared identifier 'errno'
        typename remove_reference<decltype(errno)>::type __current_errno = errno;
                                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:740:53: error: no type named 'type' in the global namespace
        typename remove_reference<decltype(errno)>::type __current_errno = errno;
                                                  ~~^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:740:76: error: use of undeclared identifier 'errno'
        typename remove_reference<decltype(errno)>::type __current_errno = errno;
                                                                           ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:742:13: error: use of undeclared identifier 'errno'
            errno = __save_errno;
            ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/locale:776:44: error: use of ...
(more)
edit retag flag offensive close merge delete

Comments

I can't reproduce this on my machine, but could you try explicitly adding #include <errno.h> to your main function for the minimal client?

Karsten gravatar image Karsten  ( 2018-10-15 11:49:01 -0600 )edit

@Karsten It still gives me the same error.

jihoonl gravatar image jihoonl  ( 2018-10-16 22:36:34 -0600 )edit

jihoonl@MacBook-Pro:~/work/ros2/mine/src/hello_ros2/my_cpp_pkg$ cmake --version cmake version 3.12.3

Could this be the issue?

jihoonl gravatar image jihoonl  ( 2018-10-16 22:40:49 -0600 )edit