ros2 / ros2/rclcpp

component_manager.cpp error when cross-compiled

Open
#716 1 comment 0 reactions 1 assignee View on GitHub

@mjcarroll is already working on this.

Since May 16, 2019.

bug
Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

Bug report

Required Info:

  • Operating System:
    • Android 21
  • Installation type:
    • Source
  • Version or commit hash:
    • master
  • DDS implementation:
    • Fast-RTPS
  • Client library (if applicable):
    • rclcpp
Steps to reproduce issue
When compiling for Android 21 with NDK R18b
error: ../ament_ws/install_isolated/ament_index_cpp/lib/libament_index_cpp.so: incompatible target
../ros2_android_ws/src/ros2/rclcpp/rclcpp_components/src/component_manager.cpp:63: error: undefined reference to 'ament_index_cpp::get_resource(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >&, std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> >*)

When calling function is:
std::string content;
std::string base_path;
if (!ament_index_cpp::get_resource(
    "rclcpp_components", package_name, content, &base_path))
{
  throw ComponentManagerException("Could not find requested resource in ament index");
}

Expected behavior

Compiles without adding extra parameters
Someone helpfully pointed out the commas were making me miscount the number of arguments. However, the existence of the error does still confuse me and I would like to get some input on how to resolve it if at all possible

Actual behavior

Compiled code seems to add extra parameters to the function being called?
Compiled code doesn't link with the rmw library due to error above

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.