undefined reference to `Poco::SharedLibrary
Opened this issue · 1 comments
i-am-neet commented
Hi, I trying to cross compile ros2 for raspberry pi3 on Docker.
I got these error messages:
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: warning: libyaml.so, needed by /home/developer/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so, not found (try using -rpath or -rpath-link)
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: warning: libPocoFoundation.so.50, needed by /home/developer/ros2_ws/install/rosidl_typesupport_cpp/lib/librosidl_typesupport_cpp.so, not found (try using -rpath or -rpath-link)
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/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&)'
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_delete'
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_set_input_file'
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_event_delete'
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_parse'
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/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&)'
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/ros2_ws/install/rcl_yaml_param_parser/lib/librcl_yaml_param_parser.so: undefined reference to `yaml_parser_initialize'
/home/developer/buildroot-2020.02.1/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/8.4.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: /home/developer/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&)'
collect2: error: ld returned 1 exit status
make[2]: *** [tlsf_allocator_example] Error 1
make[1]: *** [CMakeFiles/tlsf_allocator_example.dir/all] Error 2
make: *** [all] Error 2
---
Failed <<< tlsf_cpp [ Exited with code 2 ]
Aborted <<< map_msgs
Summary: 120 packages finished [16min 0s]
1 package failed: tlsf_cpp
1 package aborted: map_msgs
15 packages had stderr output: fastcdr fastrtps geometry_msgs map_msgs nav_msgs poco_vendor rcl_interfaces rclcpp rmw_fastrtps_cpp sensor_msgs shape_msgs tlsf_cpp trajectory_msgs uncrustify_vendor visualization_msgs
My toolchain file is shown as below:
# Copyright (c) 2018, ARM Limited.
# SPDX-License-Identifier: Apache-2.0
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_VERSION 1)
set(CMAKE_SYSTEM_PROCESSOR armhf)
# specify the cross compiler
set(CMAKE_C_COMPILER arm-linux-gcc)
set(CMAKE_CXX_COMPILER arm-linux-g++)
# where is the target environment
set(CMAKE_FIND_ROOT_PATH ${CMAKE_CURRENT_LIST_DIR}/install)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# This assumes that pthread will be available on the target system
# (this emulates that the return of the TRY_RUN is a return code "0"
set(THREADS_PTHREAD_ARG "0"
CACHE STRING "Result from TRY_RUN" FORCE)
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}")
Thank you for your watching.
zhoufuch commented
me too