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

how to link to ncurses library in the make file

asked 2013-07-25 11:00:18 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I would like to link to an external library of C++ ncurses. How I can do this in the make file of ROS? I use Electric.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-07-25 17:36:46 -0600

Hi there

If you want to use ncurses++ (in electric) you should add the following to your CMakeList.txt:

find_package( PkgConfig REQUIRED )
pkg_check_modules ( ncurses++ REQUIRED ncurses++ )

add_executable ( my_exec path_to_my_exec/my_exec.cpp )
target_link_libraries ( my_exec ${ncurses++_LIBRARIES} )

And then modify the manifest.xml of your package to let know ROS that you are using an external library:

<rosdep name="ncurses++"/>

I hope this helps

edit flag offensive delete link more

Question Tools


Asked: 2013-07-25 11:00:18 -0600

Seen: 1,607 times

Last updated: Jul 25 '13