0
$\begingroup$

Rosanswers logo

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

cmake_minimum_required(VERSION 2.8.3)

project(testpackagecpp)

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

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)

ament_package()

and this as the package.xml file :

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

<buildtool_depend>ament_cmake</buildtool_depend>

<buildtool_depend>rosidl_default_generators</buildtool_depend>

<build_depend>example_interfaces</build_depend>
<build_depend>rcl</build_depend>
<build_depend>rmw_implementation</build_depend>

<exec_depend>example_interfaces</exec_depend>
<exec_depend>rcl</exec_depend>
<exec_depend>rmw_implementation</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

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 ?


Originally posted by aks on ROS Answers with karma: 667 on 2018-05-02

Post score: 0


Original comments

Comment by jayess on 2018-05-02:
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

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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


Originally posted by Karsten with karma: 643 on 2018-05-02

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by dhood on 2018-05-02:
@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.

Comment by aks on 2018-05-04:
I took it from this source. Does it mean replacing 2.8.3 with 3.5 will do the trick ?

Comment by marguedas on 2018-05-07:
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

Comment by aks on 2018-05-14:
@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.

Comment by Karsten on 2018-05-14:
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: https://github.com/ros2/examples/blob/master/rclcpp/minimal_publisher/CMakeLists.txt#L17-L31

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.