Quantcast
Channel: ROS Answers: Open Source Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 417

Multiple definition of main error in catkin_make

$
0
0
What am I doing wrong. I checked [this](http://answers.ros.org/question/67128/ros-service-why-do-i-have-multiple-definitions-of-main/) but the add_executables seem to be ok. [This is my cmakeList.txt](https://drive.google.com/file/d/0B_MzoTKF7WAibTBiSUdONXZIZ1k/view?usp=sharing)
If i only use the server and client example it error is the same. Did I mix something up? [ 94%] Built target listener Scanning dependencies of target add_two_ints_server [100%] Building CXX object test_my_env/CMakeFiles/add_two_ints_server.dir/src/add_two_ints_server.cpp.o Linking CXX shared library /home/baum/catkin_ws/devel/lib/libmy_test_lib.so CMakeFiles/my_test_lib.dir/src/listener.cpp.o: In function `main': listener.cpp:(.text+0x15c): multiple definition of `main' CMakeFiles/my_test_lib.dir/src/talker.cpp.o:talker.cpp:(.text+0x0): first defined here CMakeFiles/my_test_lib.dir/src/add_two_ints_server.cpp.o: In function `main': add_two_ints_server.cpp:(.text+0x2b5): multiple definition of `main' CMakeFiles/my_test_lib.dir/src/talker.cpp.o:talker.cpp:(.text+0x0): first defined here CMakeFiles/my_test_lib.dir/src/add_two_ints_client.cpp.o: In function `main': add_two_ints_client.cpp:(.text+0x0): multiple definition of `main' CMakeFiles/my_test_lib.dir/src/talker.cpp.o:talker.cpp:(.text+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: *** [/home/baum/catkin_ws/devel/lib/libmy_test_lib.so] Error 1 make[1]: *** [test_my_env/CMakeFiles/my_test_lib.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

Viewing all articles
Browse latest Browse all 417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>