Linking CXX executable error
I'm absolute beginner in Ubuntu and ROS. I'm using 14.04 LTS (virtualbox) and indigo .I'm just getting started learning ROS and I'm going through the tutorials WritingTeleopNode . I am trying to create to write a teleoperation node and use it to drive the turtle in the turtlesim. First , I create learning_joy/src/turtle_teleop_joy.cpp and the launch File launch/turtle_joy.launch as mentioned in the tutorial . But after adding the following lines to my CMakeLists.txt file:
add_executable(turtle_teleop_joy src/turtle_teleop_joy.cpp)
target_link_libraries(turtle_teleop_joy ${catkin_LIBRARIES})
then building my workspace with catkin_make ,I'm getting the following error :
Linking CXX executable /home/usr/catkin_ws/devel/lib/learning_joy/turtle_teleop_joy
Update
Thanks Peter there is the full output :
tayssir@tayssir-VirtualBox:~/catkin_ws$ catkin_make
Base path: /home/tayssir/catkin_ws
Source space: /home/tayssir/catkin_ws/src
Build space: /home/tayssir/catkin_ws/build
Devel space: /home/tayssir/catkin_ws/devel
Install space: /home/tayssir/catkin_ws/install
####
#### Running command: "cmake /home/tayssir/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/tayssir/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/tayssir/catkin_ws/install -G Unix Makefiles" in "/home/tayssir/catkin_ws/build"
####
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /home/tayssir/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/tayssir/catkin_ws/devel;/opt/ros/indigo
-- This workspace overlays: /home/tayssir/catkin_ws/devel;/opt/ros/indigo
-- Found PythonInterp: /usr/bin/python (found version "2.7.6")
-- 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/tayssir/catkin_ws/build/test_results
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.6.19
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 2 packages in topological order:
-- ~~ - test_vitesse_turtle
-- ~~ - learning_joy
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'test_vitesse_turtle'
-- ==> add_subdirectory(test_vitesse_turtle)
-- +++ processing catkin package: 'learning_joy'
-- ==> add_subdirectory(learning_joy)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/tayssir/catkin_ws/build
####
#### Running command: "make -j1 -l1" in "/home/tayssir/catkin_ws/build"
####
Scanning dependencies of target turtle_teleop_joy
[100%] Building CXX object learning_joy/CMakeFiles/turtle_teleop_joy.dir/src/turtle_teleop_joy.cpp.o
Linking CXX executable /home/tayssir/catkin_ws/devel/lib/learning_joy/turtle_teleop_joy
[100%] Built target turtle_teleop_joy
tayssir@tayssir-VirtualBox:~/catkin_ws$
The message you've posted is not an error, it's just the compiler telling you it's started linking the executable. Are there any further error after this? If so can you post the full output of catkin_make. Thanks.
This output is telling you that it has successfully built everything, there are no errors here.
If you've sourced your workspace you should be able to run the turtle_teleop_joy node now.
I know , the code is working but the build is failed because the linking Line appears like an error with red color :
I'm looking for solution that makes the build with no errors or warnings.
There is no error here.
Even that looks red line ? Sorry but because I'am new here so I can not upload image of error.
This is one of the very few instances where posting screenshots of terminals is ok.
Please post a screenshot of your terminal showing the line you mention. I've given you sufficient karma to make that possible.
thanks @gvdhoorn . I update the question with the screenshot.