Rosanswers logo

I followed the first actionlib tutorial exactly, first creating a new workspace. I added all dependencies as in the tutorial and building the workspace worked fine. When running the fibonacci_server, the tutorial states:

You will see something similar to:

[ INFO] 1250790662.410962000: Started node [/fibonacci], pid [29267], bound on [aqy], xmlrpc port [39746], tcpros port [49573], logging to [~/ros/ros/log/fibonacci_29267.log], using [real] time

However, this info is not displayed. The server runs without error and rostopic list -v lists the same topics as in the tutorial. Furthermore, running rqt_graph results in a single block fibonacci with two topics color and /fibonacci as opposed to the graph in the tutorial.

I then continued with the client, following the tutorial precisely again. After creating the fibonacci_client.cpp file and editing the CMakeLists.txt, catkin_make fails:

achille@W530:~/Documents/tutorial_ws$ catkin_make
Base path: /home/achille/Documents/tutorial_ws
Source space: /home/achille/Documents/tutorial_ws/src
Build space: /home/achille/Documents/tutorial_ws/build
Devel space: /home/achille/Documents/tutorial_ws/devel
Install space: /home/achille/Documents/tutorial_ws/install
#### Running command: "make cmake_check_build_system" in "/home/achille/Documents/tutorial_ws/build"
-- Using CATKIN_DEVEL_PREFIX: /home/achille/Documents/tutorial_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/achille/Documents/tutorial_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/achille/Documents/tutorial_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/achille/Documents/tutorial_ws/build/test_results
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.6
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:

-- ~~  - actionlib_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'actionlib_tutorials'
-- ==> add_subdirectory(actionlib_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
-- Generating .msg files for action actionlib_tutorials/Fibonacci /home/achille/Documents/tutorial_ws/src/actionlib_tutorials/action/Fibonacci.action
-- actionlib_tutorials: 7 messages, 0 services
-- Configuring done
CMake Error at actionlib_tutorials/CMakeLists.txt:138 (add_executable):
  Cannot find source file:


  Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
  .hxx .in .txx
CMake Warning (dev) at actionlib_tutorials/CMakeLists.txt:151 (add_dependencies):
  Policy CMP0046 is not set: Error on non-existent dependency in
  add_dependencies.  Run "cmake --help-policy CMP0046" for policy details.
  Use the cmake_policy command to set the policy and suppress this warning.
  The dependency target "fibonacci_client" of target "fibonacci_server" does
  not exist.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error: CMake can not determine linker language for target: fibonacci_server
CMake Error: Cannot determine link language for target "fibonacci_server".
-- Generating done
-- Build files have been written to: /home/achille/Documents/tutorial_ws/build
Makefile:920: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

The build part of my CMakelists.txt is as follows (dropping comments):

# include

  fibonacci_server src/fibonacci_server.cpp
  fibonacci_client src/fibonacci_client.cpp



I'm not sure if this error is related to the earlier abnormality. I tried the minimal example for CMakelists.txt that the tutorial provides instead of the autogenerated one. Only when I add in the fibonacci_client, building fails. I tried some suggestions online but none solved this problem.

I'm running ROS Kinetic on Ubuntu Xenial 16.04. The actionlib_tutorials package is also installed in /opt/ros/... but I sourced so that roscd yields the correct path.

Originally posted by achille on ROS Answers with karma: 464 on 2017-07-01

Post score: 1

Original comments

Comment by gvdhoorn on 2017-07-02:
Can you make sure that you've actually added add_executable(fibonacci_client src/fibonacci_client.cpp) (note the src/ there), and not just add_executable(fibonacci_client fibonacci_client.cpp), or even add_executable(fibonacci_client)?

Comment by achille on 2017-07-02:
That's the case. Updated my question with the BUILD part of the CMakeLists.txt file


1 Answer 1


Rosanswers logo

  fibonacci_server src/fibonacci_server.cpp
  fibonacci_client src/fibonacci_client.cpp

I can't answer the first part of your question, but the above is not how add_executable(..) works.

See the CMake documentation for add_executable(..):

Add an executable to the project using the specified source files.

add_executable(<name> [WIN32] [MACOSX_BUNDLE]
               source1 [source2 ...])

Adds an executable target called <name> to be built from the source files listed in the command invocation. The <name> corresponds to the logical target name and must be globally unique within a project. The actual file name of the executable built is constructed based on conventions of the native platform (such as <name>.exe or just <name>.

The first argument to add_executable(..) is the name of a single executable, with all the following arguments being the source files that together make up the binary.

In your CMake snippet, you seem to have intended to build both executables with a single add_executable(..). As should now be clear, that doesn't work.

The tutorial you linked to also doesn't do that (note the: "Add the following lines to your CMakeLists.txt"), it has the server in its own add_executable(..) (here) and the client as well (here).

Finally: even if this were possible from the CMake side, it still wouldn't work: there can only be a single entry point in any executable binary and both the server and the client have a main(..).

Originally posted by gvdhoorn with karma: 86574 on 2017-07-02

This answer was ACCEPTED on the original site

Post score: 0

Original comments

Comment by gvdhoorn on 2017-07-02:
Did this also clear up the problem with the output of the server binary?

Comment by achille on 2017-07-02:
It did. Graph looks different from the one on the tutorial though and still has this weird 'color' attribute. Bedankt!

Comment by gvdhoorn on 2017-07-03:
The color that you see is a bug. See #q249553.

Comment by count_dueki on 2018-06-17:
I got the same problem that achille had. even when I follow the guidelines gvdhoorn provided still there is no output from the binary server. But topics with subs and pubs are present, yet not connected to the node. Any ideas?


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.