micro-ROS / micro_ros_raspberrypi_pico_sdk

Raspberry Pi Pico (RP2040) and micro-ROS integration
Apache License 2.0
179 stars 52 forks source link

Fix clockid_t compile error #1195

Closed willbsp closed 3 months ago

willbsp commented 3 months ago

I was having compile errors when running make:

/home/will/Desktop/micro-ros-project/micro_ros_raspberrypi_pico_sdk/pico_uart_transport.c:11:19: error: unknown type name 'clockid_t'
   11 | int clock_gettime(clockid_t unused, struct timespec *tp)
      |                   ^~~~~~~~~
make[2]: *** [CMakeFiles/micro-ros-project.dir/build.make:90: CMakeFiles/micro-ros-project.dir/micro_ros_raspberrypi_pico_sdk/pico_uart_transport.c.obj] Error 1

I found that I needed to add #include <time.h> in pico_uart_transport.c.

I am compiling on a Raspberry Pi 5 running Ubuntu 24.04 LTS with ROS2 Jazzy.

pablogs9 commented 3 months ago

That makes sense, thanks for the patch!

pablogs9 commented 3 months ago

@mergify backport humble iron rolling

mergify[bot] commented 3 months ago

backport humble iron rolling

✅ Backports have been created

* [#1196 Fix clockid_t compile error (backport #1195)](https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk/pull/1196) has been created for branch `humble` * [#1197 Fix clockid_t compile error (backport #1195)](https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk/pull/1197) has been created for branch `iron` * [#1198 Fix clockid_t compile error (backport #1195)](https://github.com/micro-ROS/micro_ros_raspberrypi_pico_sdk/pull/1198) has been created for branch `rolling`