最新消息: USBMI致力于为网友们分享Windows、安卓、IOS等主流手机系统相关的资讯以及评测、同时提供相关教程、应用、软件下载等服务。

ubuntu装gcc linux公社,Ubuntu 14.04 LST安装GCC 4.1.2

IT圈 admin 9浏览 0评论

ubuntu装gcc linux公社,Ubuntu 14.04 LST安装GCC 4.1.2

由于编译源码软件需要在Ubuntu 14.04 LST用到gcc4.1.2版本,但是本机已经安装有gcc4.8.4,下载gcc4.1.2源码编译总会出现运行找不到库文件错误,或者i386和x86_64不兼容问题,网上都有相似问题的解答,最终安装成功。

1. 下载&解压源码

$ wget .1.2/gcc-4.1.2.tar.bz2$ tar xvjf gcc-4.1.2.tar.bz2

2. 安装依赖库, 以及软件

$ sudo apt-getinstall libc6-dev libgmp-dev libmpfr-dev texinfo

3. 为头文件以及所需库添加链接

添加如下链接, 这取决于你的 Ubuntu 系统架构, 如果你使用的是64位的ubuntu系统应当使用x86_64-linux-gnu替代i386-linux-gnu

$ cd /usr/include

$ sudo ln -s i386-linux-gnu/bits bits

$ sudo ln -s i386-linux-gnu/gnu gnu

$ sudo ln -s i386-linux-gnu/sys sys

$ sudo ln -s i386-linux-gnu/asmasm$ cd /usr/lib

$ sudo ln -s i386-linux-gnu/crt1.o crt1.o

$ sudo ln -s i386-linux-gnu/crti.o crti.o

$ sudo ln -s i386-linux-gnu/crtn.o crtn.o

4. 编译gcc

$ cd gcc-4.1.2$ mkdir build

$ cd build

$ ../configure --prefix=/usr/local--program-prefix=sse---libexecdir=/usr/local/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --enable-languages=c,c++$ make bootstrap

如果出现了如下错误:

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.

请使用以下命令编译:

$ make bootstrap MAKEINFO=makeinfo

5. 安装gcc

$ make install

$ cd /usr/local/bin

$ ll *gcc*

看到类似以下几个文件, 安装就完成了

i686-pc-linux-gnu-gcc-4.1.2 i686-pc-linux-gnu-ssegcc ssegcc ssegccbug

GCC 的详细介绍:请点这里

ubuntu装gcc linux公社,Ubuntu 14.04 LST安装GCC 4.1.2

由于编译源码软件需要在Ubuntu 14.04 LST用到gcc4.1.2版本,但是本机已经安装有gcc4.8.4,下载gcc4.1.2源码编译总会出现运行找不到库文件错误,或者i386和x86_64不兼容问题,网上都有相似问题的解答,最终安装成功。

1. 下载&解压源码

$ wget .1.2/gcc-4.1.2.tar.bz2$ tar xvjf gcc-4.1.2.tar.bz2

2. 安装依赖库, 以及软件

$ sudo apt-getinstall libc6-dev libgmp-dev libmpfr-dev texinfo

3. 为头文件以及所需库添加链接

添加如下链接, 这取决于你的 Ubuntu 系统架构, 如果你使用的是64位的ubuntu系统应当使用x86_64-linux-gnu替代i386-linux-gnu

$ cd /usr/include

$ sudo ln -s i386-linux-gnu/bits bits

$ sudo ln -s i386-linux-gnu/gnu gnu

$ sudo ln -s i386-linux-gnu/sys sys

$ sudo ln -s i386-linux-gnu/asmasm$ cd /usr/lib

$ sudo ln -s i386-linux-gnu/crt1.o crt1.o

$ sudo ln -s i386-linux-gnu/crti.o crti.o

$ sudo ln -s i386-linux-gnu/crtn.o crtn.o

4. 编译gcc

$ cd gcc-4.1.2$ mkdir build

$ cd build

$ ../configure --prefix=/usr/local--program-prefix=sse---libexecdir=/usr/local/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --disable-multilib --enable-languages=c,c++$ make bootstrap

如果出现了如下错误:

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.

请使用以下命令编译:

$ make bootstrap MAKEINFO=makeinfo

5. 安装gcc

$ make install

$ cd /usr/local/bin

$ ll *gcc*

看到类似以下几个文件, 安装就完成了

i686-pc-linux-gnu-gcc-4.1.2 i686-pc-linux-gnu-ssegcc ssegcc ssegccbug

GCC 的详细介绍:请点这里

发布评论

评论列表 (0)

  1. 暂无评论