Open AnthonyZJiang opened 11 months ago
Found a few issues mentioning this error. And within these, I found a temporary solution and it still works:
https://github.com/micro-ROS/micro_ros_arduino/issues/1378#issuecomment-1653329938
I may track down the issue if I get time or no one else is interested in doing so.
This error is related to a version mismatch between the compiler used for building the micro-ROS library and your local compiler.
Could you provide the compiler version you are using for building your application?
Arduino: 1.8.5 (Linux), TD: 1.58, Board: "Teensy 4.1, Serial, 600 MHz, Faster, US English"
"/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=158 -DARDUINO=10805 -DARDUINO_TEENSY41 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-I/home/kriz/arduino-1.8.5/hardware/teensy/avr/cores/teensy4" "-I/home/kriz/Arduino/libraries/micro_ros_arduino/src" "-I/home/kriz/arduino-1.8.5/hardware/teensy/avr/libraries/NativeEthernet/src" "-I/home/kriz/arduino-1.8.5/hardware/teensy/avr/libraries/FNET/src" "/home/kriz/arduino-1.8.5/hardware/teensy/avr/libraries/FNET/src/port/cpu/mimxrt/fnet_mimxrt.c" -o "/dev/null"
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino_build_643732/sketch/micro-ros_publisher.ino.cpp.o: in function `timer_callback(rcl_timer_s*, long long)':
/home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:36: undefined reference to `rcl_publish'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino_build_643732/sketch/micro-ros_publisher.ino.cpp.o: in function `setup':
/home/kriz/Arduino/libraries/micro_ros_arduino/src/micro_ros_arduino.h:33: undefined reference to `rmw_uros_set_custom_transport'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino_build_643732/sketch/micro-ros_publisher.ino.cpp.o: in function `setup':
/home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:49: undefined reference to `rcutils_get_default_allocator'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:52: undefined reference to `rclc_support_init'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:55: undefined reference to `rclc_node_init_default'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:58: undefined reference to `rosidl_typesupport_c__get_message_type_support_handle__std_msgs__msg__Int32'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:58: undefined reference to `rclc_publisher_init_default'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:66: undefined reference to `rclc_timer_init_default'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:73: undefined reference to `rclc_executor_init'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:74: undefined reference to `rclc_executor_add_timer'
/home/kriz/.arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/../lib/gcc/arm-none-eabi/11.3.1/../../../../arm-none-eabi/bin/ld: /tmp/arduino_build_643732/sketch/micro-ros_publisher.ino.cpp.o: in function `loop':
/home/kriz/Arduino/libraries/micro_ros_arduino/examples/micro-ros_publisher/micro-ros_publisher.ino:81: undefined reference to `rclc_executor_spin_some'
collect2: error: ld returned 1 exit status
Using library micro_ros_arduino at version 2.0.7-humble in folder: /home/kriz/Arduino/libraries/micro_ros_arduino
Using library NativeEthernet at version 1.0.5 in folder: /home/kriz/arduino-1.8.5/hardware/teensy/avr/libraries/NativeEthernet
Using library FNET at version 0.1.3 in folder: /home/kriz/arduino-1.8.5/hardware/teensy/avr/libraries/FNET
Error compiling for board Teensy 4.1.
I cannot see the compiler version here, also this is not the same error as before.
Issue template
Steps to reproduce the issue
I was in general following the tutorial teensy_with_arduino. The steps I took differently to the tutorial were:
~/.arduino15/packages/teensy/hardware/avr/1.58.1
. Therefore, in the step that requires to replace the platform.txt, I ran the following:Note that I also used humble instead of foxy in the link.
I followed the tutorial until the last step in "Program the Teensy". The code did not compile.
Expected behavior
The code should compile.
Actual behavior
I received the following error:
Additional information