Ask Your Question

I can't catkin_make

asked 2020-02-24 02:48:56 -0500

流水疾翔 gravatar image

system:vmware15.5pro ubuntu18.04.2 ros melodic

Base path: /home/liu/testpkg
Source space: /home/liu/testpkg/src
Build space: /home/liu/testpkg/build
Devel space: /home/liu/testpkg/devel
Install space: /home/liu/testpkg/install
#### Running command: "make cmake_check_build_system" in "/home/liu/testpkg/build"
-- Using CATKIN_DEVEL_PREFIX: /home/liu/testpkg/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/melodic
-- This workspace overlays: /opt/ros/melodic

-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/liu/testpkg/build/test_results
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") 
-- Using Python nosetests: /usr/bin/nosetests-2.7

-- catkin 0.7.20
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - learning_topic
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'learning_topic'
-- ==> add_subdirectory(learning_topic)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
  add_message_files() directory not found:

Call Stack (most recent call first):
  learning_topic/CMakeLists.txt:80 (add_message_files)

-- Configuring incomplete, errors occurred!
See also "/home/liu/testpkg/build/CMakeFiles/CMakeOutput.log".
See also "/home/liu/testpkg/build/CMakeFiles/CMakeError.log".
Makefile:530: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed

and i found a solution of commenting out the following lines,which didn't work

## add_message_files
## add_service_files
## generate_messages

what should i do?

here is the error log:

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/liu/testpkg/build/CMakeFiles/CMakeTmp

 Run Build Command:"/usr/bin/make" "cmTC_9f8ac/fast"
    /usr/bin/make -f CMakeFiles/cmTC_9f8ac.dir/build.make CMakeFiles/cmTC_9f8ac.dir/build
    make[1]: 进入目录“/home/liu/testpkg/build/CMakeFiles/CMakeT

Building C object CMakeFiles/cmTC_9f8ac.dir/CheckSymbolExists.c.o
/usr/bin/cc    -o CMakeFiles/cmTC_9f8ac.dir/CheckSymbolExists.c.o   -c /home/liu/testpkg/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c

 Linking C executable cmTC_9f8ac
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9f8ac.dir/link.txt --verbose=1
    /usr/bin/cc      -rdynamic CMakeFiles/cmTC_9f8ac.dir/CheckSymbolExists.c.o  -o cmTC_9f8ac 
    collect2: error: ld returned 1 exit status

     CMakeFiles/cmTC_9f8ac.dir/build.make:97: recipe for target 'cmTC_9f8ac' fail

    make[1]: *** [cmTC_9f8ac] Error 1
    make[1]: 离开目录“/home/liu/testpkg/build/CMakeFiles/CMakeTmp”
    Makefile:126: recipe for target 'cmTC_9f8ac/fast' failed
    make: *** [cmTC_9f8ac/fast] Error 2

    File /home/liu/testpkg/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:

    /* */
    #include <pthread.h>

    int main(int argc, char** argv)

#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
      return 0;

    Determining if the function pthread_create exists in the pthreads failed with the following output:
    Change Dir: /home/liu/testpkg/build/CMakeFiles/CMakeTmp

    Run Build Command:"/usr ...
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2020-02-24 04:31:30 -0500

gvdhoorn gravatar image

The error message states:

add_message_files() directory not found:

Does a directory called msg exist in /home/liu/testpkg/src/learning_topic?

What is the output of ls -al /home/liu/testpkg/src/learning_topic/msg?

Call Stack (most recent call first):
  learning_topic/CMakeLists.txt:80 (add_message_files)

As a check: can you show us the lines in your CMakeLists.txt around line 80?

edit flag offensive delete link more


thanks for your answer. i solve this question by recovery the image of the early space of the vm,and i try second this time,it works,without the exist of dictionary msg and Personmsg in it. i am so puzzled and wondering what have happeded...but as a new learner i can't figure out why. by the way,the 80 line of the Cmakelist is the same as what it is being when created.

流水疾翔 gravatar image 流水疾翔  ( 2020-02-24 07:01:08 -0500 )edit

By the way,the 80 line of the Cmakelist is the same as what it is being when created.

If you want us to help you, you'll have to show us the code. We cannot guess what you see.

gvdhoorn gravatar image gvdhoorn  ( 2020-02-24 07:22:43 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2020-02-24 02:48:56 -0500

Seen: 54 times

Last updated: Feb 24