colcon build errors... Failed <<< rclpy [8.28s, exited with code 2]
Hi everyone.
I faced a problem that failed colccon build ros2_humble on ubuntu 20.04. I followed the building as this link
But I failed in this step: colcon build --symlink-install.
And got the error below:
--- stderr: rclpy
In file included from /home/zuo2/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/node.hpp:24, from /home/zuo2/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/action_client.hpp:26, from /home/zuo2/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/_rclpy_pybind11.cpp:24: /home/zuo2/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/context.hpp: In destructor ‘rclpy::InitOptions::~InitOptions()’: /home/zuo2/ros2_humble/src/ros2/rclpy/rclpy/src/rclpy/context.hpp:49:7: error: ‘PyErr_WarnFormat’ was not declared in this scope; did you mean ‘PyErr_Format’?49 | PyErr_WarnFormat(
| ^~~~~~~~~~~~~~~~
| PyErr_Formatmake[2]: * [CMakeFiles/_rclpy_pybind11.dir/build.make:76: CMakeFiles/_rclpy_pybind11.dir/src/rclpy/_rclpy_pybind11.cpp.o] error 1
make[1]: * [CMakeFiles/Makefile2:104:CMakeFiles/_rclpy_pybind11.dir/all] error 2
make: * [Makefile:141:all] error 2
--- Failed <<< rclpy [8.28s, exited with code 2]
Aborted <<< action_tutorials_interfaces [2.03s]
Aborted <<< rclcpp [8.69s]
Aborted <<< rviz_rendering [1min 40s]
Summary: 189 packages finished [2min 31s]
1 package failed: rclpy
3 packages aborted: action_tutorials_interfaces rclcpp rviz_rendering
1 package had stderr output: rclpy
147 packages not processed
What is the cause?