catkin_make does not work in publisher and subscriber
Hello I have followed the beginner tutorials in http://wiki.ros.org/ROS/Tutorials and i have made every change recommended in the tutorial but when I type catkin_make, I get the following error. I am using ROS kinetic on Ubuntu 16.04
petros@petros-Lenovo-ideapad-100-15IBD:~/catkin_ws$ catkin_make
Base path: /home/petros/catkin_ws
Source space: /home/petros/catkin_ws/src
Build space: /home/petros/catkin_ws/build
Devel space: /home/petros/catkin_ws/devel
Install space: /home/petros/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/petros/catkin_ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/petros/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/petros/catkin_ws/devel;/opt/ros/kinetic
-- This workspace overlays: /home/petros/catkin_ws/devel;/opt/ros/kinetic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.12", minimum required is "2")
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/petros/catkin_ws/build/test_results
-- Found gtest sources under '/usr/src/gmock': gtests will be built
-- Found gmock sources under '/usr/src/gmock': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.12")
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.29
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 1 packages in topological order:
-- ~~ - beginner_tutorials
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'beginner_tutorials'
-- ==> add_subdirectory(beginner_tutorials)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- beginner_tutorials: 1 messages, 1 services
-- Configuring done
-- Generating done
-- Build files have been written to: /home/petros/catkin_ws/build
####
#### Running command: "make -j4 -l4" in "/home/petros/catkin_ws/build"
####
[ 0%] Built target std_msgs_generate_messages_eus
[ 0%] Built target std_msgs_generate_messages_cpp
[ 0%] Built target std_msgs_generate_messages_lisp
[ 0%] Built target std_msgs_generate_messages_py
[ 0%] Built target _beginner_tutorials_generate_messages_check_deps_AddTwoInts
[ 0%] Built target _beginner_tutorials_generate_messages_check_deps_Num
[ 0%] Built target std_msgs_generate_messages_nodejs
[ 11%] Built target beginner_tutorials_generate_messages_cpp
[ 29%] Built target beginner_tutorials_generate_messages_eus
[ 41%] Built target beginner_tutorials_generate_messages_lisp
Scanning dependencies of target talker
Scanning dependencies of target listener
[ 64%] Built target beginner_tutorials_generate_messages_py
[ 76%] Built target beginner_tutorials_generate_messages_nodejs
[ 82%] Building CXX object beginner_tutorials/CMakeFiles/listener.dir/src/listener.cpp.o
[ 88%] Building CXX object beginner_tutorials/CMakeFiles/talker.dir/src/talker.cpp.o
[ 88%] Built target beginner_tutorials_generate_messages
/home/petros/catkin_ws/src/beginner_tutorials/src/listener.cpp: In function ‘void chatterCallback(const ConstPtr&)’:
/home/petros/catkin_ws/src/beginner_tutorials/src/listener.cpp:8:46: error: ‘ROS_INFO’ was not declared in this scope
ROS_INFO("I heard: [%s]", msg->data.c_str());
^
/home/petros/catkin_ws/src/beginner_tutorials/src/listener.cpp: In function ‘int main(int, char**)’:
/home/petros/catkin_ws/src/beginner_tutorials/src/listener.cpp:23:3: error: ‘init’ is not a member of ‘ros’
ros::init(argc, argv, "listener");
^
/home/petros/catkin_ws/src/beginner_tutorials/src/listener.cpp:30:3: error: ‘NodeHandle’ is not a member of ‘ros’
ros::NodeHandle n;
^
/home/petros/catkin_ws/src/beginner_tutorials/src/listener.cpp:47:3: error: ‘Subscriber’ is not a member of ‘ros’
ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);
^
/home/petros/catkin_ws/src/beginner_tutorials/src/listener.cpp:54:3: error: ‘spin’ is not a member of ‘ros’
ros::spin();
^
beginner_tutorials/CMakeFiles/listener.dir/build.make:62: recipe for target 'beginner_tutorials/CMakeFiles/listener.dir/src/listener.cpp.o' failed ...