0
$\begingroup$

Rosanswers logo

So I am trying to use the biotac_drivers package here: https://github.com/kth-ros-pkg/biotac_driver

I would like to link to "/lib/x86_64-linux-gnu/libdl.so.2".

I know how to link a ROS package just fine but I'm coming up empty on how to link system dependencies.

On hydro, Ubuntu 3.11.10

Just incase I'm completely wrong on what I need to do here is the error:

Linking CXX executable /home/ablasdel/catkin_ws/devel/lib/biotac_sensors/biotac_pub

/usr/bin/ld: CMakeFiles/biotac_pub.dir/src/cheetah.c.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5'

/usr/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib/x86_64-linux-gnu/libdl.so.2 so try adding it to the linker command line

/lib/x86_64-linux-gnu/libdl.so.2: could not read symbols: Invalid operation

collect2: error: ld returned 1 exit status

make[2]: *** [/home/ablasdel/catkin_ws/devel/lib/biotac_sensors/biotac_pub] Error 1

make[1]: *** [biotac_driver/biotac_sensors/CMakeFiles/biotac_pub.dir/all] Error 2

make: *** [all] Error 2

Invoking "make" failed


Originally posted by Aaron Blasdel on ROS Answers with karma: 211 on 2014-04-09

Post score: 1

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

Glad that works for you.

For others with similar problems, a more complete answer can be found here:


Originally posted by joq with karma: 25443 on 2014-04-09

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by Aaron Blasdel on 2014-04-09:
That link broke with the package format 2 rollout here are the latest links:

http://docs.ros.org/api/catkin/html/howto/format2/system_library_dependencies.html

And for legacy format 1 if you are into that:

http://docs.ros.org/api/catkin/html/howto/format1/system_library_dependencies.html

Comment by joq on 2014-08-02:
Thanks for noticing. I updated that link to the format2 version.

$\endgroup$
0
$\begingroup$

Rosanswers logo

Solved my own problem...

The issue was in the cmakelists.txt: target_link_libraries(biotac_pub ${catkin_LIBRARIES} -lm -ldl)

I added -ldl to the target link libraries and everything is AOK now.


Originally posted by Aaron Blasdel with karma: 211 on 2014-04-09

This answer was NOT ACCEPTED on the original site

Post score: 3


Original comments

Comment by lakehanne on 2017-02-04:
Interesting that this solved my problem.But it should be enough to specify ${catkin_LIBRARIES}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.