Hi! When converting nodes to components i found myself running into linker issues of undefined symbols at runtime, which would otherwise occur at compile/link time.
I suggest adding
target_link_options(${target} PRIVATE "-Wl,--no-undefined")
to the rclcpp_components_register_node macro, to ensure there are no undefined symbols when the generated executable is run or the component is loaded into a container later.
I'm unsure of the consequences, or if there are valid use cases for having undefined references in the component library, which is why i want to open this for discussion here first before making a PR. Please let me know if you know of any.
I think users of rclcpp_components_register_node would expect to be able to use the generated executable, which would require this anyways.