Hello,
I was working in migrating a program from ros1 to ros2, all seems to be alright but at the end of the compilation an error appears. It seems that the code is alright and its a problem with the linking. I am working in a docker of ros2 humble. Also this error only show when serialization is used.
This is the error i keep getting
/usr/bin/ld: CMakeFiles/test_rec_msgs_node.dir/src/data_handler.cpp.o: in function `rclcpp::Serialization<std::shared_ptr<std_msgs::msg::UInt8_<std::allocator<void> > > >::Serialization()':
ros2_humble | data_handler.cpp:(.text._ZN6rclcpp13SerializationISt10shared_ptrIN8std_msgs3msg6UInt8_ISaIvEEEEEC2Ev[_ZN6rclcpp13SerializationISt10shared_ptrIN8std_msgs3msg6UInt8_ISaIvEEEEEC5Ev]+0x16): undefined reference to `rosidl_message_type_support_t const* rosidl_typesupport_cpp::get_message_type_support_handle<std::shared_ptr<std_msgs::msg::UInt8_<std::allocator<void> > > >()'
This is an example of one of where the errors is ()
std::shared_ptr<rclcpp::SerializedMessage> serialized_msg;
using MessageT = std_msgs::msg::UInt8;
MessageT msg;
auto serializer = rclcpp::Serialization<MessageT>();
serializer.deserialize_message(serialized_msg.get(), &msg);
pub_timer_about_to_finish_->publish(msg);
It could be a problem of the cmake ? It seems to be alright I checked all the packages and they are included, i can attach the cmake if necessary.
Thank you for your time and reading this post