Closed zihui0325 closed 4 years ago
I checked that rclcpp_component
and tf2_ros
packages both depend on rclcpp
package with ament_target_dependencies(target rclcpp)
, but actually it doesn't link to libraries on which 'rclcpp' denpend recursively.
After I add rmw_fastrtps_cpp
and yaml
to ros2/rclcpp/rclcpp_components/CMakeLists.txt
manually as follows, it worked.
target_link_libraries(component_container component_manager)
ament_target_dependencies(component_container
"rclcpp"
"rmw_fastrtps_cpp"
"yaml"
)
However, I can build native from source successfully. There may be a problem with the ament_target_dependencies()
when cross compling ?
This repository contains a tool that performs a cross-compilation automatically. Unfortunately, the specifics of your setup are not within the scope of this tool. If you have specific feature requests for the tool, such as "allow custom toolchain file / sysroot / etc", we would very much welcome those as feature request issues. However, since this here seems specific to your manual use case, I am going to close this issue as off-topic. I would recommend perhaps https://answers.ros.org/questions/ or https://stackoverflow.com/ for this question.
I want to cross compile ros2 to Hi3559 platform with the compiler toolchains and sysroot that Hisi provide. This is the detail : https://github.com/ros2/rclcpp/issues/957#issue-543104847
I cross compiled the deps
apr
,apr-util
,log4cxx
,tinyxml
,tinyxml2
,poco
,openssl
,python3.6
in advance and install them to the target filesystem.Here is the TOOLCHAIN file. TOOLCHAIN_FILE
There are two problems when cross compiling
tf2_ros
andrclcpp_components
package, which I think can be sorted to one kind.The following are err logs:
tf2_ros
rclcpp_components
It seems like that it can not find the libraries depend on when building
librcl_interfaces__*.so
, so I add 'rpath' to cmake toolchain file , but it still doesn't work.