can't install ncurses

Posted on 2011-05-01
Last Modified: 2012-05-11

A piece of software i want to use says it needs ncurses development libraries. I don't know much about this apart from the fact they are c++ libraries and I don't have anything for c++ installed on my machine. I tried installing ncurses via the instructions here

and got this error

cd ../objects;   -I../c++ -I../include -I. -DHAVE_CONFIG_H -I. -I../include  -D_GNU_SOURCE -DNDEBUG -I/opt/ncurses/include/ncurses  -c ../c++/
/bin/sh: -I../c++: not found
make[1]: *** [../objects/cursesf.o] Error 127
make[1]: Leaving directory `/home/andrea/Downloads/ncurses-5.7/c++'
make: *** [all] Error 2

Please could you advise me?
Question by:andieje
    LVL 6

    Accepted Solution

    Hello andieje,

    from your posting i guess you are using Debian or Ubuntu... i am asking myself why don't install Ncurses from the package repository available for Debian / Ubuntu?

    you could just type "apt-get install libncurses5-dev"  - don't forget to be root...

    Here is how it looks like for me on Debian Squeeze; I used the -s (simulate) option to just simulate the installation since i did not want to install Ncurses in real...

    root@vm0-debian-squeeze:/# apt-get -s install libncurses5-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following extra packages will be installed:
      binutils cpp cpp-4.4 gcc gcc-4.4 gcc-4.4-base libc-dev-bin libc6-dev libgcc1 libgomp1 libmpfr4 libncurses5 libstdc++6 linux-libc-dev manpages-dev ncurses-bin
    Suggested packages:
      binutils-doc cpp-doc gcc-4.4-locales gcc-multilib make autoconf automake1.9 libtool flex bison gdb gcc-doc gcc-4.4-multilib libmudflap0-4.4-dev gcc-4.4-doc
      libgcc1-dbg libgomp1-dbg libmudflap0-dbg libcloog-ppl0 libppl-c2 libppl7 glibc-doc
    The following NEW packages will be installed:
      binutils gcc gcc-4.4 libc-dev-bin libc6-dev libgomp1 libmpfr4 libncurses5-dev linux-libc-dev manpages-dev
    The following packages will be upgraded:
      cpp cpp-4.4 gcc-4.4-base libgcc1 libncurses5 libstdc++6 ncurses-bin
    7 upgraded, 10 newly installed, 0 to remove and 147 not upgraded.
    Inst ncurses-bin [5.7+20100313-2] (5.7+20100313-5 Debian:6.0.1/stable)
    Conf ncurses-bin (5.7+20100313-5 Debian:6.0.1/stable)
    Inst gcc-4.4-base [4.4.4-1] (4.4.5-8 Debian:6.0.1/stable) [libstdc++6 libgcc1 cpp-4.4 ]
    Conf gcc-4.4-base (4.4.5-8 Debian:6.0.1/stable) [libstdc++6 libgcc1 cpp-4.4 ]
    Inst libstdc++6 [4.4.4-1] (4.4.5-8 Debian:6.0.1/stable) [libgcc1 cpp-4.4 ]
    Conf libstdc++6 (4.4.5-8 Debian:6.0.1/stable) [libgcc1 cpp-4.4 ]
    Inst libmpfr4 (3.0.0-2 Debian:6.0.1/stable) [libgcc1 cpp-4.4 ]
    Inst cpp-4.4 [4.4.4-1] (4.4.5-8 Debian:6.0.1/stable) [libgcc1 ]
    Inst libgcc1 [1:4.4.4-1] (1:4.4.5-8 Debian:6.0.1/stable)
    Conf libgcc1 (1:4.4.5-8 Debian:6.0.1/stable)
    Inst libncurses5 [5.7+20100313-2] (5.7+20100313-5 Debian:6.0.1/stable)
    Conf libncurses5 (5.7+20100313-5 Debian:6.0.1/stable)
    Inst binutils (2.20.1-16 Debian:6.0.1/stable)
    Inst cpp [4:4.4.3-1] (4:4.4.5-1 Debian:6.0.1/stable)
    Inst libgomp1 (4.4.5-8 Debian:6.0.1/stable)
    Inst gcc-4.4 (4.4.5-8 Debian:6.0.1/stable)
    Inst gcc (4:4.4.5-1 Debian:6.0.1/stable)
    Inst libc-dev-bin (2.11.2-10 Debian:6.0.1/stable)
    Inst linux-libc-dev (2.6.32-31 Debian:6.0.1/stable)
    Inst libc6-dev (2.11.2-10 Debian:6.0.1/stable)
    Inst libncurses5-dev (5.7+20100313-5 Debian:6.0.1/stable)
    Inst manpages-dev (3.27-1 Debian:6.0.1/stable)
    Conf libmpfr4 (3.0.0-2 Debian:6.0.1/stable)
    Conf cpp-4.4 (4.4.5-8 Debian:6.0.1/stable)
    Conf binutils (2.20.1-16 Debian:6.0.1/stable)
    Conf cpp (4:4.4.5-1 Debian:6.0.1/stable)
    Conf libgomp1 (4.4.5-8 Debian:6.0.1/stable)
    Conf gcc-4.4 (4.4.5-8 Debian:6.0.1/stable)
    Conf gcc (4:4.4.5-1 Debian:6.0.1/stable)
    Conf libc-dev-bin (2.11.2-10 Debian:6.0.1/stable)
    Conf linux-libc-dev (2.6.32-31 Debian:6.0.1/stable)
    Conf libc6-dev (2.11.2-10 Debian:6.0.1/stable)
    Conf libncurses5-dev (5.7+20100313-5 Debian:6.0.1/stable)
    Conf manpages-dev (3.27-1 Debian:6.0.1/stable)

    Open in new window


    Author Comment


    I just did that. How do you know libncurses5-dev is the corresponding file? IS there a naming convention

    The instructions i followed told me to do this:

    sudo apt-get libncurses5-dev
    make clean

    What is the difference between make clean and just make? I don't understand why i was told to issue 2 make commands (i don't know much about make)
    LVL 6

    Assisted Solution

    Hello Andieje,

    I used the command  "apt-cache search ncurses | grep ncurses" to search for the package in the repository. There i discovered the the "libncurses5-dev" package. The "-dev" stands for development...

    You just need the command "make" when you compile packages from source code. In the repository there are binary already compiled packages ready to use for you system.

    If you compile from source code you go like:

    ./configure (It examines your system to verify the existence of a compiler, libraries, utilities and other items necessary for a successful compile. It uses the information it finds to produce a custom Makefile for the software package)
    make (compiles actually the source code)
    make install (installs the compiled package)

    LVL 6

    Assisted Solution

    Here is a good link that explains how to use "apt".

    compiling from source is not needed that often since you have to keep track of dependencies and versions.... And there are thousands of packages you can install directly from the repository.

    Author Comment

    thanks for that. Very helpful. However you didn't specify the difference between make and make clean

    Author Comment

    also, do i need to do anything to clean up after my failed 'makes' or does make take care of that itself
    LVL 6

    Assisted Solution

    "make clean" cleans the source code from unneeded object files, libraries or files form previous compile. In other words there remains only files needed for compilation...
    "make" compiles the source code
    LVL 6

    Expert Comment

    also, do i need to do anything to clean up after my failed 'makes' or does make take care of that itself

    No you don't need to "make clean" after a compilation failure. Make takes care of it and starts to compile where it stopped before. This is accomplished by the help of timestamps of files as far as i know...
    LVL 30

    Assisted Solution

    by:Kerem ERSOY
    BTW apt-get will retrieve and setup a binary package. This is a source package , configured and and compiled ( using make) and then packaged into debian package.

    So there are two questions here:
    - If you are going with apt-get you wont need to compile your program yourself. If you install any fileset ending with -dev the apt-get will install prerequisite the C++ headers automatically.
    - If you'll compile your own package the steps would be:
      - untar the package
      - run the cofigure package ( ./configure --without-cxx-binding )  this is what readme suggests for
         /bin/sh: -I../c++: not found
        type of errors.
       - issue make

    I guess you've omitted the ./configure step or didi not see the readme suggesting --without-cxx-binding switch.

    LVL 30

    Expert Comment

    by:Kerem ERSOY
    The excerpt from the README

    6.  The c++ directory has C++ classes that are built on top of ncurses and
        panels.  You must have c++ (and its libraries) installed before you can
        compile and run the demo.

       Use --without-cxx-binding to tell configure to not build the C++ bindings
        and demo.

        If you do not have C++, you must use the --without-cxx option to tell
        the configure script to not attempt to determine the type of 'bool'
        which may be supported by C++.  IF YOU USE THIS OPTION, BE ADVISED THAT


    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now