ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

CMake error in ROS2

asked 2018-05-02 06:29:12 -0500

aks gravatar image

updated 2018-05-02 06:36:37 -0500

I am trying to create a ROS2 package from scratch, named testpackagecpp and have this CMakeLists.txt :

cmake_minimum_required(VERSION 2.8.3)


if(NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")

find_package(ament_cmake REQUIRED)
find_package(example_interfaces REQUIRED)
find_package(rcl REQUIRED)
find_package(rmw REQUIRED)
#find_package(rmw_implementation REQUIRED)
#force opensplice implementation
find_package(rmw_opensplice_cpp REQUIRED)
#find_package(rmw_fastrtps_cpp REQUIRED)


and this as the package.xml file :

<?xml version="1.0"?>
<package format="2">
<description>Package containing examples of how to use the rcl API.</description>
<maintainer email="">Alejandro Hernandez</maintainer>
<license>Apache License 2.0</license>






When I try to build this using ament build --symlink-install --only-package testpackagecpp, I get an error as "NOT" "element" "IN_LIST" "rcl_RECURSIVE_DEPENDENCIES". error

Any Idea where am I going wrong ?

edit retag flag offensive close merge delete



Please don't use an image to display text. Images are not searchable and people cannot copy and paste the text from the image. Please update your question with a copy and paste of the error. See our support guidelines

jayess gravatar image jayess  ( 2018-05-02 11:11:48 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-02 10:18:39 -0500

Karsten gravatar image

I believe CMake 3.5 is required. You are currently using 2.8.3

edit flag offensive delete link more


@aakash_sehgal were you following this wiki page? It incorrectly listed 2.8.3 as the ros2 minimum, which I've updated now. If you saw it somewhere else, please let us know so we can try to correct it there also.

dhood gravatar image dhood  ( 2018-05-02 15:57:50 -0500 )edit

I took it from this source. Does it mean replacing 2.8.3 with 3.5 will do the trick ?

aks gravatar image aks  ( 2018-05-04 05:41:40 -0500 )edit

Yes it should do the trick. Feel free to mark the issue as resolved if it works for you or to update your question if changing the minimum CMake version didnt fix your problem

marguedas gravatar image marguedas  ( 2018-05-07 18:06:01 -0500 )edit

@marguedas@Karsten this definitely does the trick but when i try to run the package it says no executable found. strange as it is building.

aks gravatar image aks  ( 2018-05-14 04:37:28 -0500 )edit

From the extract of your CMakeLists.txt it is not visible which executable you are trying to create and install. You can have a look at the examples repo for some code snippets:

Karsten gravatar image Karsten  ( 2018-05-14 10:16:02 -0500 )edit

Question Tools



Asked: 2018-05-02 06:29:12 -0500

Seen: 2,032 times

Last updated: May 02 '18