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

'ld: cannot find -lurdf' when building workspace

asked 2017-06-04 16:39:49 -0500

saul gravatar image

updated 2017-06-05 10:06:47 -0500

gvdhoorn gravatar image

terminal dump:

saul@saul-VirtualBox:~/Robotics/project5/catkin_ws$ catkin_make
Base path: /home/saul/Robotics/project5/catkin_ws
Source space: /home/saul/Robotics/project5/catkin_ws/src
Build space: /home/saul/Robotics/project5/catkin_ws/build
Devel space: /home/saul/Robotics/project5/catkin_ws/devel
Install space: /home/saul/Robotics/project5/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/saul/Robotics/project5/catkin_ws/build"
####
####
#### Running command: "make -j4 -l4" in "/home/saul/Robotics/project5/catkin_ws/build"
####
[ 75%] Built target robot_sim
[ 87%] Linking CXX executable /home/saul/Robotics/project5/catkin_ws/devel/lib/robot_sim/robot_sim_bringup
/usr/bin/ld: cannot find -lurdf

CMakeLists.txt for the build:

# toplevel CMakeLists.txt for a catkin workspace
# catkin/cmake/toplevel.cmake

cmake_minimum_required(VERSION 2.8.3)

set(CATKIN_TOPLEVEL TRUE)

# search for catkin within the workspace
set(_cmd "catkin_find_pkg" "catkin" "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${_cmd}
  RESULT_VARIABLE _res
  OUTPUT_VARIABLE _out
  ERROR_VARIABLE _err
  OUTPUT_STRIP_TRAILING_WHITESPACE
  ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _res EQUAL 0 AND NOT _res EQUAL 2)
  # searching fot catkin resulted in an error
  string(REPLACE ";" " " _cmd_str "${_cmd}")
  message(FATAL_ERROR "Search for 'catkin' in workspace failed (${_cmd_str}): ${_err}")
endif()

# include catkin from workspace or via find_package()
if(_res EQUAL 0)
  set(catkin_EXTRAS_DIR "${CMAKE_SOURCE_DIR}/${_out}/cmake")
  # include all.cmake without add_subdirectory to let it operate in same scope
  include(${catkin_EXTRAS_DIR}/all.cmake NO_POLICY_SCOPE)
  add_subdirectory("${_out}")

else()
  # use either CMAKE_PREFIX_PATH explicitly passed to CMake as a command line argument
  # or CMAKE_PREFIX_PATH from the environment
  if(NOT DEFINED CMAKE_PREFIX_PATH)
    if(NOT "$ENV{CMAKE_PREFIX_PATH}" STREQUAL "")
      string(REPLACE ":" ";" CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
    endif()
  endif()

  # list of catkin workspaces
  set(catkin_search_path "")
  foreach(path ${CMAKE_PREFIX_PATH})
    if(EXISTS "${path}/.catkin")
      list(FIND catkin_search_path ${path} _index)
      if(_index EQUAL -1)
        list(APPEND catkin_search_path ${path})
      endif()
    endif()
  endforeach()

  # search for catkin in all workspaces
  set(CATKIN_TOPLEVEL_FIND_PACKAGE TRUE)
  find_package(catkin QUIET
    NO_POLICY_SCOPE
    PATHS ${catkin_search_path}
    NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
  unset(CATKIN_TOPLEVEL_FIND_PACKAGE)

  if(NOT catkin_FOUND)
    message(FATAL_ERROR "find_package(catkin) failed. catkin was neither found in the workspace nor in the CMAKE_PREFIX_PATH. One reason may be that no ROS setup.sh was sourced before.")
  endif()
endif()

catkin_workspace()
edit retag flag offensive close merge delete

Comments

1

Most likely because you've a target_link_libraries(.. urdf) somewhere?

Without seeing your CMakeLists.txt this is going to be really hard to diagnose.

Please copy/paste it into your question (edit it, don't post an answer). Please also remove all the boilerplate comments from it.

gvdhoorn gravatar image gvdhoorn  ( 2017-06-05 01:32:40 -0500 )edit
1

That is not the CMakeLists.txt for your package, but the one in catkin_ws/src.

I think we'll need the one in catkin_ws/src/robot_sim.

gvdhoorn gravatar image gvdhoorn  ( 2017-06-05 10:07:42 -0500 )edit

Thanks for your help. I am new to this stuff. I am taking an on-line Robotics class from EdX. The CMakeList.txt file provided the course administrators pointed to the /opt/ros/indigo/lib. I have kinetic installed. It was an easy fix.

saul gravatar image saul  ( 2017-06-10 12:27:58 -0500 )edit

Can you please link us to that online class? CMakeLists.txt should not need to link_directories(..) directly to /opt/ros/indigo/lib, and also should not do a target_link_libraries(.. urdf).

gvdhoorn gravatar image gvdhoorn  ( 2017-06-10 13:26:40 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-06-10 12:28:51 -0500

saul gravatar image

Thanks for your help.I am taking an on-line Robotics class from EdX. The CMakeList.txt file provided the course administrators pointed to the /opt/ros/indigo/lib. I have kinetic installed. It was an easy fix.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-06-04 16:39:49 -0500

Seen: 697 times

Last updated: Jun 10 '17