Linux Programming (Building development environment--curses)

Source: Internet
Author: User
Tags unpack


Crossing, what we are going to talk about today is a little supplement to the previous content, the specific content is: Install the curses Development kit to build

Development environment. The gossip Hugh said, the words return to the positive turn.


We said in the previous building development environment content, mainly said the development environment of GCC and vim, today we will say how to build the development environment

Another tool in: curses.


Curses is a graphics library on Linux, but the mint we used only installed the library files and did not install the header files associated with the library. Didn't

With these headers, it is not possible to develop related work. So, if we want to develop some simple graphics software using Linux,

To install the associated header file, here is the detailed installation process:


1. If you are familiar with the Linux directory structure, you can use the command to view. The command to find the library file is as follows:

ll/usr/lib/i386-linux-gnu/| grep *curses* //No results, stating that the library file is not in this directory

ll/lib/i386-linux-gnu/|grep *curses*

Binary file libncurses.so.5.9 matches //has the result that the library file is in this directory


2. The library file is available, but also requires a header file associated with the library file: curses.h, the command to find the header file is as follows:

ll/usr/include/i386-linux-gnu/|grep *curses* //No results, description header file is not in this directory


3. No header file, only install it yourself .

Header file in the package, after installing the package can find the header file, but we do not know the package name, therefore, so that

Search by command:

Apt-cache Search Curses

The results of the search are as follows:

Bittornado-bittorrent Client (and Tracker) with console and curses interfaces

Iptraf-interactive Colorful IP LAN Monitor

Libcunit1-ncurses-unit testing Library for C (ncurses)

Libcunit1-ncurses-dev-unit testing Library for C (ncurses)--Development files

libncurses5-dbg-debugging/profiling Libraries for ncurses

Libncurses5-dev-developer ' s libraries for ncurses

libncursesw5-shared Libraries for terminal handling (wide character support)

libncursesw5-dbg-debugging/profiling Libraries for NCURSESW

Libncursesw5-dev-developer ' s libraries for NCURSESW

Libtinfo-dev-developer ' s library for the low-level Terminfo library

...//There is also a very good result, here are listed


We saw Libncurses5-dev-developer's libraries for ncurses The description of this package and found it on

Is the package we want, so we can install it.


4. Install the Libncurses5-dev package into the mint with the following commands:

Apt-get Install Libncurses5-dev //requires root permission to execute this command

Reading Package List ... Complete

Analyzing Dependency tree for Package

Reading status information ... Complete

The following additional packages will be installed:

Libtinfo-dev

Recommended Packages to install:

Ncurses-doc

The following "new" packages will be installed:

Libncurses5-dev Libtinfo-dev

0 packages were upgraded, 2 new packages were installed, 0 packages were uninstalled, 492 packages were not upgraded.

You need to download the 237 KB package.

1,176 KB of extra space is consumed after decompression.

Do you want to continue? [y/n] y //Confirm if you need to install the package, enter Y to indicate the installation

Get: 1 http://archive.ubuntu.com/ubuntu/trusty/main libtinfo-dev i386 5.9+20140118-1ubuntu1 [71.2 KB]

Get: 2 http://archive.ubuntu.com/ubuntu/trusty/main Libncurses5-dev i386 5.9+20140118-1UBUNTU1 [166 KB]

Download 237 KB, time 2 seconds (92.3 kb/s)

Selecting previously unselected package libtinfo-dev:i386.

(Reading Database ... The system currently has a total of 158,123 files and directories installed. )

Preparing to unpack .../libtinfo-dev_5.9+20140118-1ubuntu1_i386.deb ...

Unpacking libtinfo-dev:i386 (5.9+20140118-1UBUNTU1) ...

Selecting previously unselected package libncurses5-dev:i386.

Preparing to unpack .../libncurses5-dev_5.9+20140118-1ubuntu1_i386.deb ...

Unpacking libncurses5-dev:i386 (5.9+20140118-1UBUNTU1) ...

Setting libtinfo-dev:i386 (5.9+20140118-1UBUNTU1) ...

Setting libncurses5-dev:i386 (5.9+20140118-1UBUNTU1) ...


5. Verify the header file we are looking for: Curses.h is included in the Mint, the specific command is as follows:

ll/usr/include/|grep curses.h

-rw-r--r--1 root root 77809 March curses.h

lrwxrwxrwx 1 root root 8 March ncurses.h-curses.h

From the result of the command, you can see the header file: Curses.h is already included in the system, indicating that the package was successfully installed: Libncurses5-dev.

We can develop relevant software for this package.


If you are unfamiliar with the Linux directory structure and are not familiar with the relevant Linux commands, you can use the graphical tools: new Rieter Package Management

Install the device . The following procedures are described:


1. Open the new Rieter Package Manager, click the Search button, and in the search field, type: curses.

2. Find the package associated with the curses in the search results.

3. From the search results find libncurses5 and Libncurses5-dev These two comparison packages compare like, exactly which package is we want to

of it? Can be distinguished by the description of the package, check the package name, click the Properties button to view the properties of the package, the description of the package in the genus

In the sex. the description of the LIBNCURSES5 package is as follows:

This package includes the shared libraries that are required to run programs that are compiled with ncurses.

The description of the Libncurses5-dev package is as follows:

This package contains the header files, static libraries

and symbolic links that developers using ncurses would need.

as you can see from the description, Libncurses5-dev is the package we want .

4. Click on the right button to mark the installation.


Crossing, we found that the command to install ncurses and install Gcc,vim is the same after comparison, just to verify that the installation is successful or not

Not the same. Of course, if you forget how to install GCC, you can click here to see the previous article;

To install VIM, click here to view the previous article. Also, we're just saying here how to install the curses package to build the development

Environment, the use of packages, and the use of other tools are not introduced. If you are interested, you can click here to see how to use

GCC, click here to see how to use Vim.


Ladies and gentlemen, today's content is crossing, to know how the funeral, and listen to tell.


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Linux Programming (Build development environment--curses)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.