I am facing problem in catkin_make when trying to compile a package with camera plugin in it I may have made any mistake in CMakeLists please help

asked 2018-05-23 14:11:35 -0500

dark_poison gravatar image

[ 98%] Built target uuv_gazebo_ros_cpc_plugin [100%] Built target uuv_gazebo_ros_imu_plugin /usr/bin/ld: cannot find -lDepthCameraPlugin /usr/bin/ld: cannot find -lGpuRayPlugin /usr/bin/ld: cannot find -lContactPlugin /usr/bin/ld: cannot find -lCameraPlugin /usr/bin/ld: cannot find -lRayPlugin collect2: error: ld returned 1 exit status gazebo_car_camera_sensor_plugin/CMakeFiles/gazebo_car_camera_sensor_plugin.dir/build.make:278: recipe for target '/home/nehra/catkin_ws/devel/lib/libgazebo_car_camera_sensor_plugin.so' failed make[2]: * [/home/nehra/catkin_ws/devel/lib/libgazebo_car_camera_sensor_plugin.so] Error 1 CMakeFiles/Makefile2:17350: recipe for target 'gazebo_car_camera_sensor_plugin/CMakeFiles/gazebo_car_camera_sensor_plugin.dir/all' failed make[1]: [gazebo_car_camera_sensor_plugin/CMakeFiles/gazebo_car_camera_sensor_plugin.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: ** [all] Error 2 Invoking "make -j4 -l4" failed

~/catkin_ws ^C ~/catkin_ws

cmake_minimum_required(VERSION 2.8.3) project(gazebo_car_camera_sensor_plugin)

find_package(catkin REQUIRED COMPONENTS gazebo_plugins gazebo_ros roscpp )

find_package (gazebo REQUIRED)

catkin_package( INCLUDE_DIRS include LIBRARIES gazebo_car_camera_sensor_plugin CATKIN_DEPENDS gazebo_plugins gazebo_ros roscpp DEPENDS system_lib )

set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")

include_directories(include) include_directories( ${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIR} ${GAZEBO_INCLUDE_DIRS} ) include_directories(${ADDITIONAL_INCLUDE_DIRS} ${OGRE_INCLUDE_DIRS}/Paging)

add_library(${PROJECT_NAME} src/gazebo_ros_camera.cpp )

link_directories( ${GAZEBO_LIBRARY_DIRS}

)

target_link_libraries( ${PROJECT_NAME} ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES} )

edit retag flag offensive close merge delete

Comments

It's useful to run catkin_make VERBOSE=1 &> temp.txt then search through temp.txt to see if any of the libraries like libContactPlugin are showing up. You can also add a line like message(${GAZEBO_LIBRARIES}) to your CMakeLists.txt and see that has the missing libraries in it (it must not).

lucasw gravatar image lucasw  ( 2018-05-23 15:12:23 -0500 )edit