Skip to content

Conversation

@Muhammad0312
Copy link
Contributor

Loading the node into the component container fails as it builds a static library.

Description

Fixed documentation to build a shared library.

Fixes # (issue)

Failed to load component: Failed to load library: could not load library dlopen error: /home/mawais/repos/ros2_ws/install/ros_graph_viz/lib/libgraph_entities_component.a: invalid elf header, at ./src/shared_library.c:99

Did you use Generative AI?

No

Additional Information

Loading the node into the component container fails as it builds a static library.

Signed-off-by: Muhammad Awais  <[email protected]>
.. code-block:: cmake
add_library(vincent_driver_component src/vincent_driver.cpp)
add_library(vincent_driver_component SHARED src/vincent_driver.cpp)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default depends on BUILD_SHARED_LIBS: https://cmake.org/cmake/help/v3.31/command/add_library.html#normal-libraries

If no <type> is given the default is STATIC or SHARED based on the value of the BUILD_SHARED_LIBS variable.

but it certainly makes sense to use SHARED here.

@christophebedard christophebedard added the backport-all backport at reviewers discretion; from rolling to all versions label Jul 19, 2025
@christophebedard christophebedard merged commit bb11078 into ros2:rolling Jul 19, 2025
5 checks passed
mergify bot pushed a commit that referenced this pull request Jul 19, 2025
Loading the node into the component container fails as it builds a static library.

Signed-off-by: Muhammad Awais  <[email protected]>
(cherry picked from commit bb11078)
mergify bot pushed a commit that referenced this pull request Jul 19, 2025
Loading the node into the component container fails as it builds a static library.

Signed-off-by: Muhammad Awais  <[email protected]>
(cherry picked from commit bb11078)
mergify bot pushed a commit that referenced this pull request Jul 19, 2025
Loading the node into the component container fails as it builds a static library.

Signed-off-by: Muhammad Awais  <[email protected]>
(cherry picked from commit bb11078)
christophebedard pushed a commit that referenced this pull request Jul 19, 2025
Loading the node into the component container fails as it builds a static library.


(cherry picked from commit bb11078)

Signed-off-by: Muhammad Awais  <[email protected]>
Co-authored-by: Muhammad Awais <[email protected]>
christophebedard pushed a commit that referenced this pull request Jul 19, 2025
Loading the node into the component container fails as it builds a static library.


(cherry picked from commit bb11078)

Signed-off-by: Muhammad Awais  <[email protected]>
Co-authored-by: Muhammad Awais <[email protected]>
christophebedard pushed a commit that referenced this pull request Jul 19, 2025
Loading the node into the component container fails as it builds a static library.


(cherry picked from commit bb11078)

Signed-off-by: Muhammad Awais  <[email protected]>
Co-authored-by: Muhammad Awais <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-all backport at reviewers discretion; from rolling to all versions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants