I'm using a shared library utility that looks up symbols from a shared library (on non-windows platforms using GetProcAddress
).
This works for normal functions.
However, I need a function that is a template instantiation in a namespace.
I have confirmed using nm -gDC lib.so
that the library contains the symbol and spelled it exactly the same in my lookup attempt but it can't be found.
nm -gDC lib.so
...
0000000000009575 T rosidl_service_type_support_t const* rosidl_typesupport_cpp::get_service_type_support_handle<example_interfaces::srv::AddTwoInts>()
...
I've tried to look up:
GetProcAddress((HINSTANCE)(lib), "rosidl_typesupport_cpp::get_service_type_support_handle<example_interfaces::srv::AddTwoInts>");
but it returns a nullptr
.
Is there some special handling for template instantiations that I couldn't find?
I've found a different method that returns me what I need but I'd still be interested in any resources on why that didn't work!