如何在Debian Wheezy armel上安装g ++ 4.9? [英] How to install g++ 4.9 on Debian Wheezy armel?

查看:655
本文介绍了如何在Debian Wheezy armel上安装g ++ 4.9?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Debian 7 armel嵌入式系统目前有g ++ 4.6,我想升级到g ++ 4.9以使用新的C ++ 11功能。我如何做?



我目前的sources.list内容是:

 

deb http://security.debian.org/ wheezy / updates main
deb-src http://security.debian.org/ wheezy / updates main
deb http:// ftp.us.debian.org/debian wheezy主要非免费
deb-src http://ftp.us.debian.org/debian wheezy主要非免费

一个简单的apt-get安装包不起作用:

 

root @ arm:〜#apt-get install g ++ - 4.9
阅读包列表...完成
构建依赖关系树
阅读状态信息...完成
E:找不到包g ++ - 4.9
E:找不到regex'g ++ - 4.9'


解决方案

根据这个博文。简而言之,在安装新的G ++时,您必须告诉APT使用Jessie repos。首先带来当前的Wheezy最新:

  sudo apt-get update 
sudo apt-get upgrade

然后执行备份:-)并编辑 / etc / apt / sources。列表,以便将wheezy替换为jessie

  sudo cp /etc/apt/sources.list /etc/apt/sources.list.WHEEZY 
sudo vi / etc /apt/sources.list

现在更新软件包列表并安装4.9版本的GCC / G ++:

  sudo apt-get update 
sudo apt-get install gcc-4.9 g ++ - 4.9

此后恢复为原始包列表:

  sudo cp /etc/apt/sources.list.WHEEZY /etc/apt/sources.list 
sudo apt-get update

这将留下原始的GCC,G ++到位。如果您希望使用4.9版本进行编译,则相应地设置 CC CXX env vars或调用编译器作为 gcc-4.9 g ++ - 4.9 明确。


My Debian 7 armel embedded system currently has g++ 4.6, and I'd like to upgrade to g++ 4.9 to use new C++11 features. How do I do that?

My current sources.list contents is:


    deb http://security.debian.org/ wheezy/updates main
    deb-src http://security.debian.org/ wheezy/updates main
    deb http://ftp.us.debian.org/debian wheezy main non-free
    deb-src http://ftp.us.debian.org/debian wheezy main non-free

A simple apt-get install of the package does not work:


    root@arm:~#  apt-get install g++-4.9
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package g++-4.9
    E: Couldn't find any package by regex 'g++-4.9'

解决方案

Another workaround could be to install the g++ 4.9 packages from "Jessie", according to this blog post. Briefly, you would have to tell APT to use the Jessie repos while you are installing the new G++. First bring the current Wheezy up-to-date:

sudo apt-get update
sudo apt-get upgrade

Then do a backup :-) and edit /etc/apt/sources.list so that you replace the string "wheezy" with "jessie":

sudo cp /etc/apt/sources.list /etc/apt/sources.list.WHEEZY
sudo vi /etc/apt/sources.list

Now update the package list and install the 4.9 version of GCC/G++:

sudo apt-get update
sudo apt-get install gcc-4.9 g++-4.9

After this revert to the "original" package list:

sudo cp /etc/apt/sources.list.WHEEZY /etc/apt/sources.list
sudo apt-get update

This leaves the original GCC,G++ in place. If you wish to compile with the 4.9 version, then either set the CC and CXX env vars accordingly or invoke the compilers as gcc-4.9 or g++-4.9 explicitly.

这篇关于如何在Debian Wheezy armel上安装g ++ 4.9?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆