Skip to content

ROS2 zenoh-pico-cyclonedds-cdr-message-log demo not building #9

@brandonesau

Description

@brandonesau

I am having trouble building the ROS2 zenoh-pico-cyclonedds-cdr-message-log demo as per the README instructions.

There appears to be multiple errors I am running into.

Error 1

Running the build steps

git clone -b master https://github.com/eclipse-zenoh/zenoh-demos.git
cd zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log
mkdir -p build
cd build
cmake .. -DROS_DISTRO=humble
make

produces the following error

-- Configuring for Linux
-- Configuring done
CMake Error: INSTALL(EXPORT) given unknown export "CycloneDDS"
-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

which is solved by changing the CMakeLists.txt from

project(
  zenoh-ros2
  VERSION 1.0
  LANGUAGES C)

to

project(
  CycloneDDS
  VERSION 1.0
  LANGUAGES C)

Error 2

Making the change to CMakeLists.txt as specified above and re-running the build steps

mkdir -p build
cd build
cmake .. -DROS_DISTRO=humble
make

then produces the following error

[ 76%] Building C object CMakeFiles/z_pub_ros2.dir/z_pub_ros2.c.o
In file included from /tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/build/cyclonedds/src/core/ddsc/include/dds/dds.h:41,
                 from /tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/build/cyclonedds/src/core/cdr/include/dds/cdr/dds_cdrstream.h:16,
                 from /tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/z_pub_ros2.c:27:
/tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/build/cyclonedds/src/ddsrt/include/dds/ddsrt/log.h:384: warning: "DDS_LOG" redefined
  384 | #define DDS_LOG(cat, ...) \
      | 
<command-line>: note: this is the location of the previous definition
/tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/z_pub_ros2.c: In function ‘main’:
/tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/z_pub_ros2.c:124:9: warning: implicit declaration of function ‘dds_cdrstream_desc_from_topic_desc’ [-Wimplicit-function-declaration]
  124 |         dds_cdrstream_desc_from_topic_desc(&desc, &rcl_interfaces_msg_Log_desc);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/z_pub_ros2.c:127:20: error: too few arguments to function ‘dds_stream_write_sampleLE’
  127 |         bool ret = dds_stream_write_sampleLE((dds_ostreamLE_t *)&os, (void *)&msg, &desc);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/z_pub_ros2.c:27:
/tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/build/cyclonedds/src/core/cdr/include/dds/cdr/dds_cdrstream.h:178:17: note: declared here
  178 | DDS_EXPORT bool dds_stream_write_sampleLE (dds_ostreamLE_t * __restrict os, const struct dds_cdrstream_allocator * __restrict allocator, const void * __restrict data, const struct dds_cdrstream_desc * __restrict type);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/z_pub_ros2.c:128:9: error: too few arguments to function ‘dds_cdrstream_desc_fini’
  128 |         dds_cdrstream_desc_fini(&desc);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/z_pub_ros2.c:27:
/tmp/test-1/zenoh-demos/ROS2/zenoh-pico-cyclonedds-cdr-message-log/build/cyclonedds/src/core/cdr/include/dds/cdr/dds_cdrstream.h:235:17: note: declared here
  235 | DDS_EXPORT void dds_cdrstream_desc_fini (struct dds_cdrstream_desc *desc, const struct dds_cdrstream_allocator * __restrict allocator);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/z_pub_ros2.dir/build.make:128: CMakeFiles/z_pub_ros2.dir/z_pub_ros2.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:490: CMakeFiles/z_pub_ros2.dir/all] Error 2
gmake: *** [Makefile:156: all] Error 2

System info

  • Ubuntu 22.04
  • ROS2 Humble (installed via system package manager)
  • ros-humble-rmw-cyclonedds-cpp (installed via system package manager)
  • zenoh-bridge-dds (version 0.7.2-rc) (installed via system package manager)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions