Fail building rclpy from source
Hi everyone.
I faced a problem that fail building rclpy
from source.
I followed a official guide in this repository, but falied building during colcon build
with a log below.
Starting >>> rclpy
--- stderr: rclpy
In file included from /home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:59:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:23:3: error: unknown type name ‘rmw_message_lost_status_t’
23 | rmw_message_lost_status_t message_lost;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c: In function ‘_message_lost_to_py_object’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:171:3: error: unknown type name ‘rmw_message_lost_status_t’; did you mean ‘rmw_liveliness_lost_status_t’?
171 | rmw_message_lost_status_t * actual_data = &data->message_lost;
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| rmw_liveliness_lost_status_t
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:174:16: error: request for member ‘total_count’ in something not a structure or union
174 | actual_data->total_count,
| ^~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:175:16: error: request for member ‘total_count_change’ in something not a structure or union
175 | actual_data->total_count_change);
| ^~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c: In function ‘_get_qos_event_data_filler_function_for’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:254:12: error: ‘RCL_SUBSCRIPTION_MESSAGE_LOST’ undeclared (first use in this function)
254 | case RCL_SUBSCRIPTION_MESSAGE_LOST:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/./_rclpy_qos_event.c:254:12: note: each undeclared identifier is reported only once for each function it appears in
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c: In function ‘rclpy_init’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:625:13: warning: implicit declaration of function ‘rcl_init_options_set_domain_id’; did you mean ‘rcl_init_options_get_allocator’? [-Wimplicit-function-declaration]
625 | ret = rcl_init_options_set_domain_id(&init_options, (size_t)domain_id);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| rcl_init_options_get_allocator
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c: In function ‘rclpy_resolve_name’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:1730:19: warning: implicit declaration of function ‘rcl_node_resolve_name’; did you mean ‘rclpy_resolve_name’? [-Wimplicit-function-declaration]
1730 | rcl_ret_t ret = rcl_node_resolve_name(
| ^~~~~~~~~~~~~~~~~~~~~
| rclpy_resolve_name
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c: In function ‘rclpy_context_get_domain_id’:
/home/ksato/dev/ros2/rclpy_ws/src/rclpy/rclpy/src/rclpy/_rclpy.c:5634:19: warning: implicit declaration of function ‘rcl_context_get_domain_id’; did you mean ‘rclpy_context_get_domain_id’? [-Wimplicit-function-declaration]
5634 | rcl_ret_t ret = rcl_context_get_domain_id(context, &domain_id);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| rclpy_context_get_domain_id
make[2]: *** [CMakeFiles/rclpy.dir/build.make:63: CMakeFiles/rclpy.dir/src/rclpy/_rclpy.c.o] エラー 1
make[2]: *** 未完了のジョブを待っています....
make[1]: *** [CMakeFiles/Makefile2:140: CMakeFiles/rclpy.dir/all] エラー 2
make[1]: *** 未完了のジョブを待っています....
make: *** [Makefile:141: all] エラー 2
---
Failed <<< rclpy [23.5s, exited with code 2]
Summary: 0 packages finished [23.6s]
1 package failed: rclpy
1 package had stderr output: rclpy
What is the cause?