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

mhar's profile - activity

2016-04-10 11:08:53 -0500 received badge  Famous Question (source)
2016-03-31 18:32:07 -0500 received badge  Self-Learner (source)
2016-03-31 18:32:07 -0500 received badge  Teacher (source)
2016-03-31 12:51:43 -0500 answered a question Problems migrating to Jade -> cannot find -l:/usr/lib/.../*.so

Problem solved

The problem is less to do with the upgrade from Indigo to Jade and more about the ld version. Our older build (indigo) is still using rosbuild package config definitions (pkg_check_modules(...). As the upgraded system uses a newer version of ld (version 2.25) these rosbuild definitions were breaking.

The problem was solved by using catkin

For example:

include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
pkg_check_modules(ros-roscpp REQUIRED roscpp)
pkg_check_modules(ros-cv_bridge REQUIRED cv_bridge)
pkg_check_modules(ros-image_transport REQUIRED image_transport)

becomes

find_package(catkin REQUIRED COMPONENTS cv_bridge image_transport)

Further detail

The package config files provides paths to that are incompatible with newer versions of ld. In versions 2.25 and greater the Libs path, in the form -l:/full/path/to/library.so no longer works. Instead the newer version of ld expects the path in the form -l:library. More information can be found here: https://github.com/ros/catkin/issues/694

The problem has been resolved in some of the magic under catkin. In find_package(catkin..) catkin looks up the pkgconfig file and fixes the paths under Libs.

2016-03-31 09:43:30 -0500 received badge  Notable Question (source)
2016-03-19 15:23:49 -0500 received badge  Student (source)
2016-03-19 12:42:45 -0500 commented question Problems migrating to Jade -> cannot find -l:/usr/lib/.../*.so

I think I've given you the right CMakeLists.txt now.
@al-dev yes it complies fine with catkin on Indigo - hopefully it makes more sense now

The project is split into sub directories - so I've given you the main project CMakeLists.txt and then one of the sub directories

2016-03-19 02:20:50 -0500 received badge  Popular Question (source)
2016-03-18 17:03:52 -0500 commented question Problems migrating to Jade -> cannot find -l:/usr/lib/.../*.so

Sure, done

2016-03-18 17:02:53 -0500 received badge  Editor (source)
2016-03-18 15:07:48 -0500 commented question Problems migrating to Jade -> cannot find -l:/usr/lib/.../*.so

Yes I have - no joy there

2016-03-18 08:45:08 -0500 asked a question Problems migrating to Jade -> cannot find -l:/usr/lib/.../*.so

I am trying to migrate a project from Indigo to Jade. When I run catkin_make I get cannot find -l: errors (output below).

I am running ubuntu 15.04 and installed ROS Jade via the package manager. As it looks like it might be a problem with ld I am using version 2.25

The installation of ROS appears to be fine. I do not have the problem if I create a new project with subscribers and publishers like the ROS tutorials

Does anyone have any ideas?

$ catkin_make
Base path: /home/**/catkin_ws
Source space: /home/**/catkin_ws/src
Build space: /home/**/catkin_ws/build
Devel space: /home/**/catkin_ws/devel
Install space: /home/**/catkin_ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/**/catkin_ws/build"
####
####
#### Running command: "make -j8 -l8" in "/home/**/catkin_ws/build"
####
...
...
[  6%] Linking CXX executable ../../../../bin/a1
Building CXX object ../../../CMakeFiles/f.dir/dt.cxx.o
[  6%] /usr/bin/ld: cannot find -l:/usr/lib/x86_64-linux-gnu/libboost_signals.so
/usr/bin/ld: cannot find -l:/usr/lib/x86_64-linux-gnu/libboost_filesystem.so
/usr/bin/ld: cannot find -l:/usr/lib/x86_64-linux-gnu/libboost_system.so
...
collect2: error: ld returned 1 exit status
../../../../CMakeFiles/sc.dir/build.make:119: recipe for target 'bin/sc' failed
make[2]: *** [bin/sc] Error 1
CMakeFiles/Makefile2:1648: recipe for target '../../../../CMakeFiles/sc.dir/all' failed
make[1]: *** [../../../../CMakeFiles/sc.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
...
...

All the libraries it mentions are installed. For example

$ apt-cache policy libboost-signals-dev 
libboost-signals-dev:
  Installed: 1.55.0.2
  Candidate: 1.55.0.2
  Version table:
 *** 1.55.0.2 0
        500 http://us.archive.ubuntu.com/ubuntu/ vivid/universe amd64 Packages
        100 /var/lib/dpkg/status

CMakeLists.txt

The package is split up into many sub directories. So what follows below is the main package CMakeLists and then an example of one of the sub directory packages that is failing

cmake_minimum_required(VERSION 2.8.3)
project(main)

find_package(catkin REQUIRED COMPONENTS message_generation rospy)

catkin_package(CATKIN_DEPENDS roscpp)

...

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

...

set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}
)

catkin_python_setup()

add_subdirectory(dir1)
add_subdirectory(dir2)
add_subdirectory(sc)
add_subdirectory(dir4)
add_subdirectory(dir5)

Example sub directory CMakeLists.txt. This is just one of many that are failing:

cmake_minimum_required(VERSION 2.4.6)

# Find ros dependencies...
include($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)
pkg_check_modules(ros-roscpp REQUIRED roscpp)
pkg_check_modules(ros-cv_bridge REQUIRED cv_bridge)
pkg_check_modules(ros-image_transport REQUIRED image_transport)

set( sc_srcs
  main.cpp
  ScNode.cpp
  ${sc_moc_files} 
)

set( sc_hrs
  ScNode.h
)

# All ros libs are in the same directory
# so we just list one of them here
link_directories(
  ${ros-roscpp_LIBRARY_DIRS}
)

set( sc_libs
  ${ros-roscpp_LIBRARIES}
  ${ros-cv_bridge_LIBRARIES}
  ${ros-image_transport_LIBRARIES}
)

include_directories(
  ${ros-roscpp_conversions_INCLUDE_DIRS}
)

add_executable(sc ${sc_srcs} ${sc_hdrs})
target_link_libraries(sc ${sc_libs})
set_target_properties(sc PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)