Problem in building RVIZ tutorial (Markers: Sending Basic Shapes)
Hello there. I am a beginner in ROS.
I am trying to go through the first tutorial of RVIZ which is sending basic shape. The page is here.
I followed exactly the tutorial with my build package in the path user/catkin_ws/src. I added the file"basic_shapes.cpp" and put it under src folder. I also edited CMAKE file with the two lines from the tutorial page.
add_executable(basic_shapes src/basic_shapes.cpp)
target_link_libraries(basic_shapes ${catkin_LIBRARIES})
When I run "catkin_make", this error shows in the console.
user:~/catkin_ws$ catkin_make
Base path: /home/user/catkin_ws
Source space: /home/user/catkin_ws/src
Build space: /home/user/catkin_ws/build
Devel space: /home/user/catkin_ws/devel
Install space: /home/user/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/user/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/user/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/user/catkin_ws/devel;/home/user/simulation_ws/devel;/home/simulations/public_sim_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/user/catkin_ws/devel;/home/user/simulation_ws/devel;/home/simulations/public_sim_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/user/catkin_ws/build/test_results
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found gtest sources under '/usr/src/gmock': gtests will bebuilt
-- Using Python nosetests: /usr/local/bin/nosetests-2.7
-- catkin 0.7.18
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - using_markers
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'using_markers'
-- ==> add_subdirectory(using_markers)
-- Configuring done
CMake Error at using_markers/CMakeLists.txt:207 (add_executable):
Cannot find source file:
src/basic_shapes.cpp
Tried extensions .c .C .c++ .cc .cpp .cxx .m .M .mm .h .hh .h++ .hm .hpp
.hxx .in .txx
CMake Error: CMake can not determine linker language for target: basic_shapes
CMake Error: Cannot determine link language for target "basic_shapes".
-- Generating done
-- Build files have been written to: /home/user/catkin_ws/build
Makefile:682: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1
Invoking "make cmake_check_build_system" failed
----------
update: after running the code second time, the error below occurs:
make[2]: *** No rule to make target 'using_markers/CMakeFiles/basic_shapes.dir/build'. Stop.
CMakeFiles/Makefile2:437: recipe for target 'using_markers/CMakeFiles/basic_shapes.dir/all' failed
make[1]: *** [using_markers/CMakeFiles/basic_shapes.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
the content of CMAKE file is as follow:
cmake_minimum_required(VERSION 2.8.3)
project(using_markers)
find_package(catkin REQUIRED COMPONENTS
roscpp
visualization_msgs
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES using_markers
# CATKIN_DEPENDS roscpp visualization_msgs
# DEPENDS system_lib
)
include_directories(
# include
${catkin_INCLUDE_DIRS}
)
## Declare a C++ library
# add_library(${PROJECT_NAME}
# src/${PROJECT_NAME}/using_markers.cpp
# )
add_executable(basic_shapes src/basic_shapes.cpp)
target_link_libraries(basic_shapes ${catkin_LIBRARIES})
What is the output of:
ls -al /home/user/catkin_ws/src/using_markers/src/basic_shapes.cpp
?this is the console output:
I also tried running the "catkin_make" command again and now the console shows this error:
any idea of what's going on?
Please show your
CMakeLists.txt
. Be sure to remove all the boilerplate comments in it. We don't need those.And add your
CMakeLists.txt
to the question body. Do not post it here in a comment.sorry about that. I updated the question.