ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Linking CXX executable error

asked 2019-02-21 08:35:26 -0600

Tayssir Boubaker gravatar image

updated 2019-02-21 14:28:59 -0600

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$

Error image

edit retag flag offensive close merge delete

Comments

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.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-02-21 09:33:42 -0600 )edit

This output is telling you that it has successfully built everything, there are no errors here.

[100%] Built target turtle_teleop_joy

If you've sourced your workspace you should be able to run the turtle_teleop_joy node now.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-02-21 13:38:13 -0600 )edit

I know , the code is working but the build is failed because the linking Line appears like an error with red color :

Linking CXX executable /home/tayssir/catkin_ws/devel/lib/learning_joy/turtle_teleop_joy

I'm looking for solution that makes the build with no errors or warnings.

Tayssir Boubaker gravatar image Tayssir Boubaker  ( 2019-02-21 13:48:40 -0600 )edit

There is no error here.

gvdhoorn gravatar image gvdhoorn  ( 2019-02-21 14:13:04 -0600 )edit

Even that looks red line ? Sorry but because I'am new here so I can not upload image of error.

Tayssir Boubaker gravatar image Tayssir Boubaker  ( 2019-02-21 14:19:53 -0600 )edit
1

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.

gvdhoorn gravatar image gvdhoorn  ( 2019-02-21 14:22:22 -0600 )edit

thanks @gvdhoorn . I update the question with the screenshot.

Tayssir Boubaker gravatar image Tayssir Boubaker  ( 2019-02-21 14:33:37 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-02-21 17:49:25 -0600

Okay, I see the confusion. The line is red, but that (slightly confusingly) does not mean it's an error. If the build had failed you would not be able to run your node. Any error from a compiler or linker will include the word Error or Failed somewhere, what you're seeing is a 100% successful build.

edit flag offensive delete link more

Comments

Thanks Peter for your help.

Tayssir Boubaker gravatar image Tayssir Boubaker  ( 2019-02-22 00:25:04 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2019-02-21 08:35:26 -0600

Seen: 3,905 times

Last updated: Feb 21 '19