编译ROS包出现错误 提示:invoking "make cmake_check_build_system" failed

问题原因:不同包里不允许有重名的节点

解决方案:编辑重复的package文件夹里的CMakeLists.txt文件,对涉及到节点名称的代码进行修改

调试过程:逐行分析问题代码,问题的BUG基本都能找到原因,记住一定要从第一个ERROR开始修复,有时候出现了一堆BUG,其实都是第一个BUG引起的

贴上问题代码:

-- Using CATKIN_DEVEL_PREFIX: /home/jier/dev/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/jier/dev/catkin_ws/devel;/home/jier/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/jier/dev/catkin_ws/devel;/home/jier/catkin_ws/devel;/opt/ros/kinetic
-- Using PYTHON_EXECUTABLE: /usr/bin/python
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/jier/dev/catkin_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.8
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 2 packages in topological order:
-- ~~  - chapter2_tutorials
-- ~~  - chapter3_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'chapter2_tutorials'
-- ==> add_subdirectory(chapter2_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- chapter2_tutorials: 1 messages, 1 services
-- +++ processing catkin package: 'chapter3_tutorials'
-- ==> add_subdirectory(chapter3_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
--   date_time
--   iostreams
--   serialization
--   chrono
--   atomic
--   regex
-- Checking for module 'libopenni2'
--   No package 'libopenni2' found
-- Could NOT find OpenNI2 (missing:  OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS) 
** WARNING ** io features related to openni2 will be disabled
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
-- The imported target "vtkRenderingPythonTkWidgets" references the file
   "/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- The imported target "vtk" references the file
   "/usr/bin/vtk"
but this file does not exist.  Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
   "/usr/lib/cmake/vtk-6.2/VTKTargets.cmake"
but not all the files it references.

-- Checking for module 'libopenni2'
--   No package 'libopenni2' found
-- Could NOT find OpenNI2 (missing:  OPENNI2_LIBRARY OPENNI2_INCLUDE_DIRS) 
** WARNING ** visualization features related to openni2 will be disabled
-- looking for PCL_COMMON
-- looking for PCL_KDTREE
-- looking for PCL_OCTREE
-- looking for PCL_SEARCH
-- looking for PCL_IO
-- looking for PCL_SAMPLE_CONSENSUS
-- looking for PCL_FILTERS
-- looking for PCL_GEOMETRY
-- looking for PCL_FEATURES
-- looking for PCL_SEGMENTATION
-- looking for PCL_SURFACE
-- looking for PCL_REGISTRATION
-- looking for PCL_RECOGNITION
-- looking for PCL_KEYPOINTS
-- looking for PCL_VISUALIZATION
-- looking for PCL_PEOPLE
-- looking for PCL_OUTOFCORE
-- looking for PCL_TRACKING
-- looking for PCL_APPS
-- Could NOT find PCL_APPS (missing:  PCL_APPS_LIBRARY) 
-- looking for PCL_MODELER
-- looking for PCL_IN_HAND_SCANNER
-- looking for PCL_POINT_CLOUD_EDITOR
-- chapter3_tutorials: 0 messages, 1 services
CMake Error at chapter3_tutorials/CMakeLists.txt:57 (add_executable):
  add_executable cannot create target "example4" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/home/jier/dev/catkin_ws/src/chapter2_tutorials".  See
  documentation for policy CMP0002 for more details.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/opt/ros/kinetic/lib/libdynamic_reconfigure_config_init_mutex.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libcv_bridge.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libopencv_core3.so.3.3.1"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/opt/ros/kinetic/lib/libopencv_imgproc3.so.3.3.1" to target "example4"
  which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/opt/ros/kinetic/lib/libopencv_imgcodecs3.so.3.3.1" to target "example4"
  which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libimage_transport.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libtinyxml2.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libclass_loader.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/libPocoFoundation.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libdl.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libroslib.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/librospack.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libpython2.7.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/usr/lib/x86_64-linux-gnu/libboost_program_options.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libtinyxml.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/opt/ros/kinetic/lib/libinteractive_markers.so" to target "example4" which
  is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libtf.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libtf2_ros.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libactionlib.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libmessage_filters.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libroscpp.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/usr/lib/x86_64-linux-gnu/libboost_filesystem.so" to target "example4"
  which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_signals.so"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libxmlrpcpp.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libtf2.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/librosconsole.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/librosconsole_log4cxx.so"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/opt/ros/kinetic/lib/librosconsole_backend_interface.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/liblog4cxx.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_regex.so"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/opt/ros/kinetic/lib/libroscpp_serialization.so" to target "example4"
  which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/librostime.so" to target
  "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/opt/ros/kinetic/lib/libcpp_common.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_system.so"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_thread.so"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_chrono.so"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/usr/lib/x86_64-linux-gnu/libboost_date_time.so" to target "example4"
  which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libboost_atomic.so"
  to target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library "/usr/lib/x86_64-linux-gnu/libpthread.so" to
  target "example4" which is not built in this directory.


CMake Error at chapter3_tutorials/CMakeLists.txt:59 (target_link_libraries):
  Attempt to add link library
  "/usr/lib/x86_64-linux-gnu/libconsole_bridge.so" to target "example4" which
  is not built in this directory.


CMake Error at /opt/ros/kinetic/share/catkin/cmake/test/gtest.cmake:128 (_install):
  install TARGETS given target "example4" which does not exist in this
  directory.
Call Stack (most recent call first):
  chapter3_tutorials/CMakeLists.txt:81 (install)


-- Configuring incomplete, errors occurred!
See also "/home/jier/dev/catkin_ws/build/CMakeFiles/CMakeOutput.log".
See also "/home/jier/dev/catkin_ws/build/CMakeFiles/CMakeError.log".
Makefile:1844: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Base path: /home/jier/dev/catkin_ws
Source space: /home/jier/dev/catkin_ws/src
Build space: /home/jier/dev/catkin_ws/build
Devel space: /home/jier/dev/catkin_ws/devel
Install space: /home/jier/dev/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/jier/dev/catkin_ws/build"
####
Invoking "make cmake_check_build_system" failed

你可能感兴趣的:(ROS)