ncurses 安装出错:“/bin/sh: 1: -I../C++: not found”

1 软件环境

Ubuntu 12.04.1 LTS
ncurses 5.9

2 问题描述

最近需要把mysql移植到开发板上,在交叉编译mysql源码时需要用到ncurses。在ubuntu上安装ncurses时出错,提示“/bin/sh: 1: -I../C++: not found”。

ncurses 安装出错:“/bin/sh: 1: -I../C++: not found”

3 解决办法

在当前ncurses 5.9目录中有一个C++目录,里边有一个Makefile文件,打开之后可以看到第45行至第79行之间的变量几乎都是空的。这是因为目前的ubuntu系统中没有安装g++,所以生成makefile的configure程序没在文件系统中找到g++,所以CXX这些变量都是空的。

ncurses 安装出错:“/bin/sh: 1: -I../C++: not found”

ncurses 安装出错:“/bin/sh: 1: -I../C++: not found”
ncurses 安装出错:“/bin/sh: 1: -I../C++: not found”

在当前ubuntu中安装g++编译器就可以了。保证ubunt能够联网的情况下,在shell命令行中输入如下指令:sudo apt-get install make gcc g++,执行即可自动安装g++。

ncurses 安装出错:“/bin/sh: 1: -I../C++: not found”
安装完g++后,执行make clean 指令,清除编译结果。然后再执行configure,重新执行make对程序进行编译即可。