Ubuntu11.04安装Gcc4.4.1所出现的问题及解决方案
2013-11-22 15:02
417 查看
重要处均用粗体表示。
1.下载源码:http://mirror.bjtu.edu.cn/gnu/
2.解压 然后执行 ./configure
3.出现问题:
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+
下载GMP MPFR: http://mirror.bjtu.edu.cn/gnu/
3.解压GMP MPFR并移入gcc-4.4.1然后继续执行./configure
4.出现问题:
找不到gmp.h
5.安装GMP:
进入gmp源码目录:
执行./configure
出现错误:configure: error: No usable m4 in $PATH or /usr/5bin
安装m4
然后继续执行./configure,成功。生成Makefile
执行make&&make install&&make check
同理,照此方法安装MPFR。
6.进入gcc-4.4.1解压目录,执行./configure ( 建议执行:./configure --prefix=/usr/local/gcc-4.4.1 --enable-threads=posix --disable-checking --enable--long-long --host=i386 --with-system-zlib --enable-languages=c,c++,java )
7.执行make,出现问题:
configure: error: cannot compute suffix of object files: cannot compile
需要将gmp和mpfr目录加入到环境变量中,在/etc/profile文件末尾加上:export LD_LIBRARY_PATH=/usr/local/lib:/lib:/usr/lib,注意修改目录,之后运行#source /etc/profile使其生效即可。因为gmp和mpfr默认安装的库路径为/usr/local/lib,所以只用添加即可。
8.继续执行make,出现错误:
asm/errno.h:没有那个文件或目录
因为/usr/include/目录下没有asm,只有asm-generic,故做一个软链接,执行:
cd /usr/include
sudo ln -s asm-generic asm
9.make成功,然后执行sudo make install。
出现错误:libmpfr.so.1: cannot open shared object file: No such file or directory
执行:gedit /etc/ld.so.conf
另起一行,添加该共享库的绝对路径:/usr/local/lib
执行:ldconfig
10.安装成功,执行gcc -v 查看版本
注:最好执行gcc-4.4.1中的./configure时添加条件,否则编译时间将很长(花费我三四个小时。。)。
2013-11-22 15:03:00
1.下载源码:http://mirror.bjtu.edu.cn/gnu/
2.解压 然后执行 ./configure
3.出现问题:
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+
下载GMP MPFR: http://mirror.bjtu.edu.cn/gnu/
3.解压GMP MPFR并移入gcc-4.4.1然后继续执行./configure
4.出现问题:
找不到gmp.h
5.安装GMP:
进入gmp源码目录:
执行./configure
出现错误:configure: error: No usable m4 in $PATH or /usr/5bin
安装m4
然后继续执行./configure,成功。生成Makefile
执行make&&make install&&make check
同理,照此方法安装MPFR。
6.进入gcc-4.4.1解压目录,执行./configure ( 建议执行:./configure --prefix=/usr/local/gcc-4.4.1 --enable-threads=posix --disable-checking --enable--long-long --host=i386 --with-system-zlib --enable-languages=c,c++,java )
7.执行make,出现问题:
configure: error: cannot compute suffix of object files: cannot compile
需要将gmp和mpfr目录加入到环境变量中,在/etc/profile文件末尾加上:export LD_LIBRARY_PATH=/usr/local/lib:/lib:/usr/lib,注意修改目录,之后运行#source /etc/profile使其生效即可。因为gmp和mpfr默认安装的库路径为/usr/local/lib,所以只用添加即可。
8.继续执行make,出现错误:
asm/errno.h:没有那个文件或目录
因为/usr/include/目录下没有asm,只有asm-generic,故做一个软链接,执行:
cd /usr/include
sudo ln -s asm-generic asm
9.make成功,然后执行sudo make install。
出现错误:libmpfr.so.1: cannot open shared object file: No such file or directory
执行:gedit /etc/ld.so.conf
另起一行,添加该共享库的绝对路径:/usr/local/lib
执行:ldconfig
10.安装成功,执行gcc -v 查看版本
注:最好执行gcc-4.4.1中的./configure时添加条件,否则编译时间将很长(花费我三四个小时。。)。
2013-11-22 15:03:00
相关文章推荐
- gcc4.1.3安装ns2.28出现的问题
- Ubuntu Server 16.04安装MySQL设置远程访问出现问题的完美解决方案(error:10061)
- 解决品牌机、笔记本 安装GhostXP系统出现问题的终极解决方案
- Nginx+Tomcat+pcre 安装过程和出现的问题以及解决方案
- Linux 安装oracle11g 出现的问题及解决方案
- genymotion 安装过程和出现的问题解决方案汇总
- 安装XCode7.1后,QT5.5出现的各种问题解决方案
- sqlserver安装时出现的问题解决方案
- JBoss的安装及安装过程出现的问题解决方案
- Mysql在Linux下安装和使用过程中出现的问题及解决方案
- DB2安装后出现菜单栏乱码问题解决方案
- ubuntu采用apt-get安装软件出现依赖问题的解决方案
- MATLAB 2010b安装过程出现的问题解决方案
- genymotion模拟器安装出现的问题及解决方案
- Windows 7下安装Android,出现问题的解决方案
- Ubuntu下安装淘宝npm镜像后出现"未找到 'cnpm' 命令"问题的解决方案
- 成功完成opnet 14.5 + win7 64-bit +vs2008的安装,附包交换仿真出现的问题及解决方案
- VMware Workstation 运行出现“由于应用程序配置不正确,应用程序未能启动。重新安装应用程序可能会纠正这个问题”解决方案
- 安装emacs出现到依赖问题及解决方案
- 安装vmware出现的两个问题:gcc 安装和kernel headers安装