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

Error occurred when running command 'catkin_make_isolated --install'

asked 2016-01-21 13:46:38 -0500

ZYS gravatar image

updated 2016-01-21 13:59:21 -0500

gvdhoorn gravatar image

Based on UWSim, I want to let a AUV contact with another AUV. Thus I want to make one AUV act as publisher and another one act as subscriber. I add talker.cpp and listener.cpp by editing CMakeLists.txt file shown as below:

add_library(uwsim src/osgOceanScene.cpp




then I run command catkin_make_isolated --install after sourcing devel_isolated/setup.bash.

The error occurred shown as below:

==> make -j8 -l8 in '/home/gupta/catkin_ws_2/build_isolated/uwsim'

[  1%] Built target media_files

[  7%] Built target uwsim_plugins_simdev

Scanning dependencies of target uwsim

Linking CXX shared library /home/gupta/catkin_ws_2/devel_isolated/uwsim/lib/

CMakeFiles/uwsim.dir/src/listener.cpp.o: In function `main':

listener.cpp:(.text+0x163): multiple definition of `main'

CMakeFiles/uwsim.dir/src/talker.cpp.o:talker.cpp:(.text+0x0): first defined here

collect2: ld returned 1 exit status

make[2]: *** [/home/gupta/catkin_ws_2/devel_isolated/uwsim/lib/] Error 1

make[1]: *** [CMakeFiles/uwsim.dir/all] Error 2

make: *** [all] Error 2

<== Failed to process package 'uwsim': 

  Command '/home/gupta/catkin_ws_2/install_isolated/ make -j8 -l8' returned non-zero exit status 2

Reproduce this error by running:

==> cd /home/gupta/catkin_ws_2/build_isolated/uwsim && /home/gupta/catkin_ws_2/install_isolated/ make -j8 -l8

Command failed, exiting.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-22 03:08:29 -0500

Javier Perez gravatar image


Problem is you are adding a main function in each file you are adding. Besides this, I'm not sure if that is what you want to do as you are adding code to the UWSim core and I guess you are not accessing UWSim internal information or modifying its behavior.

But as I said I'm just guessing you do not need to modify UWSim core, so adding a publisher and subscriber to your AUV code should be enough (outside UWSim) unless you want to do something more "realistic" simulating communications through water requiring access to vehicle positions, scene, environment... (In that case I would suggest reading wiki it is still incomplete but a good starting point).

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-01-21 13:46:38 -0500

Seen: 356 times

Last updated: Jan 22 '16