Skip to content

CMake Args Ignored #140

@eeyang92

Description

@eeyang92

Hi, hopefully this is the right place to ask this - I've been trying to create a statically linked package via rclcpp, but whenever I run the command colcon build --cmake-args -DBUILD_SHARED_LIBS=OFF on the examples project (https://github.com/ros2/examples), I get:

...

Finished <<< examples_rclcpp_minimal_subscriber [12.3s]
--- stderr: examples_rclcpp_minimal_timer
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_SHARED_LIBS

...

Summary: 13 packages finished [25.9s]
  7 packages had stderr output: examples_rclcpp_minimal_action_client examples_rclcpp_minimal_action_server examples_rclcpp_minimal_client examples_rclcpp_minimal_publisher examples_rclcpp_minimal_service examples_rclcpp_minimal_subscriber examples_rclcpp_minimal_timer

If I attempt to run the executable in the /install/examples_rclcpp_minimal_publisher/lib/examples_rclcpp_minimal_publisher, in a fresh terminal (without sourcing the setup.bash file) I'll get an error stating:

./publisher_member_function: error while loading shared libraries: librclcpp.so: cannot open shared object file: No such file or directory

Which (I think) confirms that the arg was ignored.

Am I missing something?


Ubuntu 18.04 LTS
cmake version 3.10.2
colcon version-check:

colcon-argcomplete 0.2.2: newer version available (0.2.3)
colcon-bash 0.3.1: up-to-date
colcon-cmake 0.2.4: up-to-date
colcon-core 0.3.14: up-to-date
colcon-defaults 0.2.1: up-to-date
colcon-devtools 0.2.1: up-to-date
colcon-library-path 0.2.0: up-to-date
colcon-metadata 0.2.1: up-to-date
colcon-notification 0.2.5: up-to-date
colcon-output 0.2.3: up-to-date
colcon-package-information 0.2.1: up-to-date
colcon-package-selection 0.2.1: up-to-date
colcon-parallel-executor 0.2.2: up-to-date
colcon-pkg-config 0.1.0: up-to-date
colcon-powershell 0.3.3: up-to-date
colcon-python-setup-py 0.2.1: up-to-date
colcon-recursive-crawl 0.2.0: up-to-date
colcon-ros 0.3.5: up-to-date
colcon-test-result 0.3.0: up-to-date
colcon-zsh 0.3.1: up-to-date

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions