ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

ROS2: Linker error Poco not found

asked 2018-07-24 05:37:32 -0600

updated 2018-07-25 03:24:08 -0600

Hello,

I am trying to cross-compile ROS2 for Arm. The steps I am following can be found in here: https://github.com/ros2-for-arm/ros2/...

The build command used is colcon build --symlink-install --cmake-force-configure --cmake-args -DCMAKE_TOOLCHAIN_FILE=aarch64_toolchainfile.cmake -DTHIRDPARTY=ON -DBUILD_TESTING:BOOL=OFF

The poco library cannot be found, however it is in "/work/ROS2_Bouncy/ros2_ws/install/poco_vendor/lib/libPocoFoundation.so.50" and it is correctly cross-compiled:

/work/ROS2_Bouncy/ros2_ws/install/poco_vendor/lib/libPocoFoundation.so.50: ELF 64-bit LSB shared object, ARM aarch64, version 1 (GNU/Linux), dynamically linked, BuildID[sha1]=6ba44c72e2162ca056b0dbde681dd4a8b5da5e35, not stripped

I wonder where I can modify the CMake script to specify the path to the thirdparty libraries. I tried to specify manually the path to Poco but it did not work:

add_library(Poco_import SHARED IMPORTED)
set_target_properties(Poco_import PROPERTIES
    IMPORTED_LOCATION "/work/ROS2_Bouncy/ros2_ws/install/poco_vendor/lib/libPocoFoundation.so.50"
)

Everything look to be compiled correctly, but I got an error at the linking stage: Hopefully you can guide me to solve this issue. Let me know if you need more logs. Thanks !

Failed   <<< examples_rclcpp_minimal_publisher  [ Exited with code 2 ]
--- stderr: examples_rclcpp_minimal_timer
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libPocoFoundation.so.50, needed by /work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so, not found (try using -rpath or -rpath-link)
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libyaml.so, needed by /work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so, not found (try using -rpath or -rpath-link)
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_event_delete'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_parse'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::getSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_delete'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_initialize'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::hasSymbol(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so: undefined reference to `Poco::SharedLibrary::SharedLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_set_input_file'
collect2: error: ld returned 1 exit status
gmake[2]: *** [timer_lambda] Error 1
gmake[1]: *** [CMakeFiles/timer_lambda.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libPocoFoundation.so.50, needed by /work/ROS2_Bouncy/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so, not found (try using -rpath or -rpath-link)
/work/Documents/aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/6.1.1/../../../../aarch64-linux-gnu/bin/ld: warning: libyaml.so, needed by /work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so, not found (try using -rpath or -rpath-link)
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_event_delete'
/work/ROS2_Bouncy/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to ...
(more)
edit retag flag offensive close merge delete

Comments

I tried adding the path to the Poco library in CMAKE_EXE_LINKER_FLAGS (-L) but no success.

pokitoz gravatar image pokitoz  ( 2018-07-26 04:00:01 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2018-08-02 03:53:48 -0600

updated 2018-08-02 04:03:36 -0600

I found a quick fix solution by adding

set(PATH_POCO_LIB "${CMAKE_CURRENT_LIST_DIR}/build/poco_vendor/poco_external_project_install/lib/")
set(PATH_YAML_LIB "${CMAKE_CURRENT_LIST_DIR}/build/libyaml_vendor/libyaml_install/lib/")
set(CMAKE_BUILD_RPATH "${PATH_POCO_LIB};${PATH_YAML_LIB}")

at the end of the toolchain file to specify the path to the missing libraries.

edit flag offensive delete link more
0

answered 2020-01-21 13:42:36 -0600

I'm building Melodic on Raspberry pi 4 and this worked for me:

sudo apt-get install libpoco-dev ros-cmake-modules

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2018-07-24 05:37:32 -0600

Seen: 1,560 times

Last updated: Aug 02 '18