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

Linking Problems in Ubuntu 11.10

asked 2011-10-27 12:03:23 -0500

rado0x54 gravatar image

Hi ROS Community,

I think this question could be a little bit off topic, but I since this community has a lot of expertise in building stuff, I think it's a good place to ask.

I'm trying to build a bigger project, which I moved into the ROS build environment. In 11.04 it builds just fine. In 11.10 there it cannot find any(!) dependencies, even though they are all in the call!

ok this is what rosmake generates:

/usr/bin/c++   -O2 -g    -L/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/armadillo_wrapper/lib -Wl,-rpath,/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/armadillo_wrapper/lib -larmadillo -L/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/ace_wrapper/lib -Wl,-rpath,/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/ace_wrapper/lib -lACE -L/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/ois_wrapper/lib -Wl,-rpath,/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/ois_wrapper/lib -lOIS -Wl,-rpath,/opt/ros/electric/stacks/visualization_common/ogre/ogre/lib -L/opt/ros/electric/stacks/visualization_common/ogre/ogre/lib/OGRE -Wl,-rpath,/opt/ros/electric/stacks/visualization_common/ogre/ogre/lib,-rpath,/opt/ros/electric/stacks/visualization_common/ogre/ogre/lib/OGRE -L/opt/ros/electric/stacks/visualization_common/ogre/ogre/lib -lOgreRTShaderSystem -lOgreMain -lpthread -L/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/physx2_wrapper/lib -Wl,-rpath,/home/mriedel/MPI/repos/TeleKyb2/trunk/stacks/telekyb_deps/physx2_wrapper/lib -lNxCharacter -lNxCooking -lPhysXCore -lPhysXLoader CMakeFiles/SwarmSimX.dir/Main.cpp.o CMakeFiles/SwarmSimX.dir/PhysXDebugRenderer/PhysXDebugRenderer.cpp.o CMakeFiles/SwarmSimX.dir/PhysicEnginePhysX/PhysicEnginePhysX.cpp.o CMakeFiles/SwarmSimX.dir/PhysicEnginePhysX/PhysicEnginePhysXErrorStream.cpp.o CMakeFiles/SwarmSimX.dir/PhysicEnginePhysX/PhysicNodePhysX.cpp.o CMakeFiles/SwarmSimX.dir/PhysicEnginePhysX/RayCastAdapter.cpp.o CMakeFiles/SwarmSimX.dir/RenderEngineOGRE3D/RenderEngineOGRE3D.cpp.o CMakeFiles/SwarmSimX.dir/RenderEngineOGRE3D/RootRenderNodeOGRE3D.cpp.o CMakeFiles/SwarmSimX.dir/RenderEngineOGRE3D/VisualRenderNodeOGRE3D.cpp.o CMakeFiles/SwarmSimX.dir/RenderEngineOGRE3D/LightRenderNodeOGRE3D.cpp.o CMakeFiles/SwarmSimX.dir/RenderEngineOGRE3D/CameraRenderNodeOGRE3D.cpp.o CMakeFiles/SwarmSimX.dir/RenderEngineOGRE3D/DrawerOgre3D.cpp.o CMakeFiles/SwarmSimX.dir/RenderEngineOGRE3D/CustomCameraMan.cpp.o CMakeFiles/SwarmSimX.dir/Architect/Architect.cpp.o CMakeFiles/SwarmSimX.dir/Architect/SceneLoader.cpp.o CMakeFiles/SwarmSimX.dir/DriverLoaderService/DriverLoaderService.cpp.o CMakeFiles/SwarmSimX.dir/Utilities/Utilities.cpp.o  -o SwarmSimX -rdynamic -L/opt/ros/electric/stacks/ros_comm/utilities/xmlrpcpp/lib -L/opt/ros/electric/stacks/ros_comm/messages/std_msgs/lib -L/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_serialization/lib -L/opt/ros/electric/stacks/ros_comm/utilities/cpp_common/lib -L/opt/ros/electric/stacks/ros_comm/utilities/rostime/lib -L/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/lib -L/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp/lib -L/opt/ros/electric/stacks/ros_comm/tools/rosconsole/lib ../../libraries/libSwarmSim.so -lros -lrosconsole -lroscpp_serialization -lrostime -lXmlRpc -Wl,-rpath,/opt/ros/electric/stacks/ros_comm/utilities/xmlrpcpp/lib:/opt/ros/electric/stacks/ros_comm/messages/std_msgs/lib:/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_serialization/lib:/opt/ros/electric/stacks/ros_comm/utilities/cpp_common/lib:/opt/ros/electric/stacks/ros_comm/utilities/rostime/lib:/opt/ros/electric/stacks/ros_comm/clients/cpp/roscpp_traits/lib:/opt/ros/electric/stacks/ros_comm/clients ...
(more)
edit retag flag offensive close merge delete

Comments

Please include the linker errors in your post.
tfoote gravatar image tfoote  ( 2011-10-27 12:52:52 -0500 )edit
Hey tfoote, the linker errors are easy to explain. First it complains about pthread. If i add -lpthread at the end of my first call it starts complaining about other things. I think ACE, Ogre Armadillo. I add these and it start's complaining about PhysX.
rado0x54 gravatar image rado0x54  ( 2011-10-27 17:34:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-10-27 13:09:51 -0500

Chad Rockey gravatar image

In Ubuntu 11.10, the --as-needed flag was enabled by default. You just need to link everything in the proper order. http://ubuntuforums.org/showthread.php?p=11395419#post11395419

Make sure you link everything properly in your manifest.xml. Here was the fix for laser_drivers. Note how pthread is linked here (in the library's package).

<cpp lflags="-Wl,-rpath,${prefix}/sicktoolbox/lib -L${prefix}/sicktoolbox/lib -lsicklms-1.0 -lpthread" cflags="-I${prefix}/sicktoolbox/include"/>
edit flag offensive delete link more

Comments

Thank you. This seem the reason for my problem. I'm going to try it right away.
rado0x54 gravatar image rado0x54  ( 2011-10-27 17:35:48 -0500 )edit
Awesome, that was the reason! To be honest, I lazily put the output of rospack export (lfags,cpp) into CMAKE_SHARED_LINKER_FLAGS and CMAKE_EXE_LINKER_FLAGS. Now I fixed my Cmake Setup and everything is working fine. Thanks a million!
rado0x54 gravatar image rado0x54  ( 2011-10-27 23:52:55 -0500 )edit

Question Tools

Stats

Asked: 2011-10-27 12:03:23 -0500

Seen: 729 times

Last updated: Oct 27 '11