ubuntu下安装ns2出错:
......
checking for gcc... gcc
checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
......
貌似少了gcc,所以在网上找到gcc的安装方法,开始动手安装~
1.下载压缩包: gcc-4.1.0.tar.bz2
2.解压缩,输入命令: tar jxvf gcc-4.1.0.tar.bz2
解压后会新出现一个名为gcc-4.1.0的目录,该目录为源目录(srcdir).在这个目录的INSTALL目录下有详细的GCC安装说明,用浏览器打开index.html就可以阅读.
3.建立一个目标目录(objdir),用于存放编译的结果.GCC建议编译后的文件不要放在源目录中, 最好单独存放在另外一个目录中,而且不要是源目录的子目录.
如,建立一个和源目录同级的目标目录gcc-make
$ mkdir gcc-make
$cd gcc-make
以下的操作约是在目标目录下进行.
4.配置,决定最终的安装目录(destdir).注意安装目录不能与源目录或目标目录相同.
命令为: $(srcdir)/configure --prefix=(destdir)
我用的命令是: $sudo ../gcc-4.1.0/configure --prefix=/usr/local/gcc-4.1.0
将gcc安装在/usr/local/gcc-4.1.0目录下,使用sudo是因为不是以root用户登录的.如果以root用户登录,则可以不用sudo.
5.编译并安装
命令为:$sudo make && make install
但在gcc进行make时出错:
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
在网上搜索后发现可能是makeinfo的问题,因为gcc4.1以上的版本需要makeinfo的版本为4.2或更高。
所以输入:
makeinfo --version 想查看makeinfo的版本。结果得到了以下信息:
The program 'makeinfo' is currently not installed. You can install it by typing:
sudo apt-get install texinfo
按照提示输入命令,问题得到解决。
......
checking for gcc... gcc
checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
......
貌似少了gcc,所以在网上找到gcc的安装方法,开始动手安装~
1.下载压缩包: gcc-4.1.0.tar.bz2
2.解压缩,输入命令: tar jxvf gcc-4.1.0.tar.bz2
解压后会新出现一个名为gcc-4.1.0的目录,该目录为源目录(srcdir).在这个目录的INSTALL目录下有详细的GCC安装说明,用浏览器打开index.html就可以阅读.
3.建立一个目标目录(objdir),用于存放编译的结果.GCC建议编译后的文件不要放在源目录中, 最好单独存放在另外一个目录中,而且不要是源目录的子目录.
如,建立一个和源目录同级的目标目录gcc-make
$ mkdir gcc-make
$cd gcc-make
以下的操作约是在目标目录下进行.
4.配置,决定最终的安装目录(destdir).注意安装目录不能与源目录或目标目录相同.
命令为: $(srcdir)/configure --prefix=(destdir)
我用的命令是: $sudo ../gcc-4.1.0/configure --prefix=/usr/local/gcc-4.1.0
将gcc安装在/usr/local/gcc-4.1.0目录下,使用sudo是因为不是以root用户登录的.如果以root用户登录,则可以不用sudo.
5.编译并安装
命令为:$sudo make && make install
但在gcc进行make时出错:
WARNING: `makeinfo' is missing on your system. You should only need it if
you modified a `.texi' or `.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy `make' (AIX,
DU, IRIX). You might want to install the `Texinfo' package or
the `GNU make' package. Grab either from any GNU archive site.
在网上搜索后发现可能是makeinfo的问题,因为gcc4.1以上的版本需要makeinfo的版本为4.2或更高。
所以输入:
makeinfo --version 想查看makeinfo的版本。结果得到了以下信息:
The program 'makeinfo' is currently not installed. You can install it by typing:
sudo apt-get install texinfo
按照提示输入命令,问题得到解决。