Closed luator closed 4 years ago
@vincentberenz what do you think?
@luator
Maybe the issue occurs because some of shared_memory is header based, so the client library is the one making the linkage ? The update seems correct to me, but would be happy to also get @MaximilienNaveau opinion
@MaximilienNaveau do you approve this? (I could overwrite this with my admin power but officially I need two approvals to merge :) ).
Description
Code using the multi-process time series fails with a linker error unless
rt
andpthread
are explicitly linked to, even if the corresponding code is not using any of them directly (see, for example, the demos in robot_interfaces).It seems to me that this is caused by some dependency not exporting their dependency on these libraries correctly. I tried to trace it down to the lowest level in the dependency tree where these libraries are used which seems to be shared_memory. Indeed exporting them in the
catkin_package
command removes the need for explicitly linking against them in robot_interfaces.I'm a bit unsure, though, if this is really the right place to fix this (hence only a draft PR for now). What is a bit confusing me is that
shared_memory
is already listed incatkin_package(LIBRARIES ...)
which is linking againstrt
andpthread
. I would have assumed that this is enough for depending packages but apparently it is not.How I Tested
Just compiled.
Do not merge before
We agreed that this is the right way to do it.