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

How do I remove rdynamic from link options?

asked 2016-04-07 16:12:42 -0500

duffany1 gravatar image

I've determined that a certain library I am using is not working properly because CMake is appending -rdynamic to the c++ compiler options for my node's object file. In other words, if I copy and paste the /usr/bin/c++ command generated when using VERBOSE=true catkin_make, and I run that command manually, the node works correctly only if I remove the -rdynamic flag.

How can I edit CMakeLists.txt to remove the -rdynamic flag, and will this cause ROS to break in unexpected ways?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-04-07 16:39:19 -0500

duffany1 gravatar image

Figured it out:


edit flag offensive delete link more


If it is really necessary, I'd recommend doing it just for the target that needs it, instead of resetting linking flags for the entire project. CMake supports configuring flags on a per target basis, see target_compile_options.

gvdhoorn gravatar image gvdhoorn  ( 2016-04-08 02:39:27 -0500 )edit

I found that I can do the same with:

set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-export-dynamic")

Which I think is a bit more self documenting

dheater gravatar image dheater  ( 2018-11-01 19:20:10 -0500 )edit

Question Tools


Asked: 2016-04-07 16:12:42 -0500

Seen: 22,100 times

Last updated: Apr 07 '16