用Ubuntu在linux下安装GCC,在配置的时候出现错误。请高手帮忙!
已经解压了,按照书上的两条命令执行后mkdirgcc-buildcdgcc-build(书上说用来存放编译结果,然后书上就写了这条命令../gcc-4.6.1/confi...
已经解压了,按照书上的两条命令执行后mkdir gcc-build cd gcc-build(书上说用来存放编译结果,然后书上就写了这条命令../gcc-4.6.1/configure --prefix=/usr/local/gcc-4.6.1
但我执行出现错误,如下。首先说明,我看了我系统下/usr/local/下好像没有gcc-4.6.1这个文件夹,在/usr/local/下也不能建文件夹。求高手帮忙!感激不尽
jxust@jxust-VirtualBox:~$ cd gcc-build
jxust@jxust-VirtualBox:~/gcc-build$ ../gcc-4.6.1/configure --prefix=/usr/local/gcc-4.6.1
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.
jxust@jxust-VirtualBox:~/gcc-build$
jxust@jxust-VirtualBox:~$ cd gcc-build
jxust@jxust-VirtualBox:~/gcc-build$ su
密码:
masu:认证失败
jxust@jxust-VirtualBox:~/gcc-build$ make install
make[1]: 正在进入目录 `/home/jxust/gcc-build'
/bin/bash ../gcc-4.6.1/mkinstalldirs /usr/local/gcc-4.6.1 /usr/local/gcc-4.6.1
mkdir -p -- /usr/local/gcc-4.6.1 /usr/local/gcc-4.6.1
mkdir: 无法创建目录 “/usr/local/gcc-4.6.1”: 权限不够
mkdir: 无法创建目录 “/usr/local/gcc-4.6.1”: 权限不够
make[1]: *** [installdirs] 错误 1
make[1]:正在离开目录 `/home/jxust/gcc-build'
make: *** [install] 错误 2 展开
但我执行出现错误,如下。首先说明,我看了我系统下/usr/local/下好像没有gcc-4.6.1这个文件夹,在/usr/local/下也不能建文件夹。求高手帮忙!感激不尽
jxust@jxust-VirtualBox:~$ cd gcc-build
jxust@jxust-VirtualBox:~/gcc-build$ ../gcc-4.6.1/configure --prefix=/usr/local/gcc-4.6.1
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... /bin/sed
checking for gawk... no
checking for mawk... mawk
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl.exe... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2
checking for objdir... .libs
checking for the correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.2+, MPFR 2.3.1+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations. Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/. See also
http://gcc.gnu.org/install/prerequisites.html for additional info. If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files. They may be located in separate packages.
jxust@jxust-VirtualBox:~/gcc-build$
jxust@jxust-VirtualBox:~$ cd gcc-build
jxust@jxust-VirtualBox:~/gcc-build$ su
密码:
masu:认证失败
jxust@jxust-VirtualBox:~/gcc-build$ make install
make[1]: 正在进入目录 `/home/jxust/gcc-build'
/bin/bash ../gcc-4.6.1/mkinstalldirs /usr/local/gcc-4.6.1 /usr/local/gcc-4.6.1
mkdir -p -- /usr/local/gcc-4.6.1 /usr/local/gcc-4.6.1
mkdir: 无法创建目录 “/usr/local/gcc-4.6.1”: 权限不够
mkdir: 无法创建目录 “/usr/local/gcc-4.6.1”: 权限不够
make[1]: *** [installdirs] 错误 1
make[1]:正在离开目录 `/home/jxust/gcc-build'
make: *** [install] 错误 2 展开
4个回答
展开全部
sudo mkdir /usr/local/gcc-4.6.1 建文件夹
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
后面的数字随机应变啊
追问
那个数字是按照我所安装的版本来写的
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2011-10-21
展开全部
设置 好 源
直接安装 更新 就可以了
直接安装 更新 就可以了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询