Closed txlei closed 3 years ago
I suspect that getting rid of ${rmf_traffic_ros2_LIBRARIES}
from target_link_libraries
should fix this error.
The targets that it says are missing are executable targets, not library targets. I suspect those targets must be inadvertently getting lumped into rmf_traffic_ros2_LIBRARIES
by ament. I'll take a look at the rmf_traffic_ros2
cmake script to see if we can fix that upstream.
removed ${rmf_traffic_ros2_LIBRARIES}
but still producing same error.
Do these errors happen if you remove uses of ament_target_dependencies
?
yeap. but as mentioned in the first post, there would be other build errors.
...
fatal error: rmf_traffic_ros2/schedule/Writer.hpp: No such file or directory
3 | #include <rmf_traffic_ros2/schedule/Writer.hpp>
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Which of your targets is getting that missing include error? Whichever one it is, you probably need to add a
target_link_libraries(<your_target_name>
PUBLIC
rmf_traffic_ros2::rmf_traffic_ros2
)
It looks like you're creating a bunch of executable targets that are only using ament_target_dependencies
to link libraries to them. If ament_target_dependencies
is removed, then they won't have any dependencies linked.
@mxgrey thanks, changing to the right target solved the problem.
Hi, i have problem with linking the rmf libraries. been on it for some time before posting this. Could you advise please.
Using
ament_target_dependencies
, produced this error but I've check that/install/rmf_traffic_ros2/lib/schedule
exist.without using
ament_target_dependencies
though${rmf_traffic_ros2_LIBRARIES}
is specified, below error generatedcmakelist.txt as follows