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

Revision history [back]

click to hide/show revision 1
initial version

if you use catkin_make you can add compiler flags (as with cmake) via command line (not sure whether this is possible with rosmake):

catkin_make -DCMAKE_CXX_FLAGS=-pthread\ -std=c++11\ -Wl,--no-as-needed -DCMAKE_C_FLAGS="-pthread\ -std=c++11\ -Wl,--no-as-needed

Note that you need to escape the spaces.

Or you can set them in your CMakeLists.txt (works for both, catkin and rosmake):

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++11 -Wl,--no-as-needed" ) 
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -std=c++11 -Wl,--no-as-needed" )

Linker flags set with CMAKE_EXE_LINKER_FLAGS, CMAKE_MODULE_LINKER_FLAGS, CMAKE_SHARED_LINKER_FLAGS

if you use catkin_make you can add compiler flags (as with cmake) via command line (not sure whether this is possible with rosmake):

catkin_make -DCMAKE_CXX_FLAGS=-pthread\ -std=c++11\ -Wl,--no-as-needed -DCMAKE_C_FLAGS="-pthread\ -DCMAKE_C_FLAGS=-pthread\ -std=c++11\ -Wl,--no-as-needed

Note that you need to escape the spaces.

Or you can set them in your CMakeLists.txt (works for both, catkin and rosmake):

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++11 -Wl,--no-as-needed" ) 
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -std=c++11 -Wl,--no-as-needed" )

Linker flags set with CMAKE_EXE_LINKER_FLAGS, CMAKE_MODULE_LINKER_FLAGS, CMAKE_SHARED_LINKER_FLAGS