How to install Readline/libreadline in Ubuntu?

Readline is used to read a line after editing. To work with readline in C/C++, you must install the readline packages.

Let’s see the different readline packages

$ apt-cache search readline

libreadline-dev - GNU readline and history libraries, development files
libreadline-java - GNU readline and BSD editline wrappers for Java
libreadline-java-doc - API docs for readline/editline wrappers for Java
libreadline5 - GNU readline and history libraries, run-time libraries
libreadline5-dbg - GNU readline and history libraries, debugging libraries
libreadline5-dev - GNU readline and history libraries, development files
libreadline6 - GNU readline and history libraries, run-time libraries
libreadline6-dbg - GNU readline and history libraries, debugging libraries
libreadline6-dev - GNU readline and history libraries, development files

You can see a number of packages. To work with readline, the important requirements are
libreadline: For running applications using readline command
libreadline-dev: For developing applications using readline. Compilation purposes

Let’s install the packages

$ sudo apt-get install libreadline6 libreadline6-dev

Now you can successfully compile a readline program

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s