如何在Debian喘息阿梅尔安装G ++ 4.9? [英] How to install g++ 4.9 on Debian Wheezy armel?
问题描述
我的Debian 7阿梅尔嵌入式系统目前拥有G ++ 4.6,我想升级到G ++ 4.9使用新的C ++ 11的特性。我该怎么做呢?
我目前的sources.list的内容是:
DEB http://security.debian.org/~~V喘息/主更新
DEB-SRC http://security.debian.org/喘息/更新主
DEB http://ftp.us.debian.org/debian~~V喘息主要非自由
DEB-SRC http://ftp.us.debian.org/debian喘息主要非自由
一个简单的apt-get安装包不起作用:
根@手臂:〜#的apt-get安装G ++ - 4.9
读取软件包列表...完成
的依赖关系树
读取状态信息...完成
E:无法找到包的g ++ - 4.9
E:无法找到任何正则表达式包G ++ - 4.9
另一个解决办法可能是安装G ++从杰西4.9程序包,按<一个href=\"https://solarianprogrammer.com/2015/01/13/raspberry-pi-raspbian-install-gcc-compile-cpp-14-programs/\">this博客文章。简单地说,你必须告诉APT,而你正在安装新的G ++使用杰西回购。首先把当前喘息了最新的:
sudo易于得到更新
sudo易于得到升级
然后做一个备份:-)和编辑的/etc/apt/sources.list
,这样你替换字符串喘息
与杰西
:
须藤CP的/etc/apt/sources.list /etc/apt/sources.list.WHEEZY
sudo的VI的/etc/apt/sources.list
现在更新软件包列表,并安装4.9版本的GCC / G ++的:
sudo易于得到更新
sudo易于得到安装gcc-4.9 G ++ - 4.9
在此恢复到原始的软件包列表:
须藤CP /etc/apt/sources.list.WHEEZY的/etc/apt/sources.list
sudo易于得到更新
这离开原来的GCC,G ++到位。如果你想与4.9版编译,然后要么将 CC
和 CXX
ENV相应瓦尔或调用编译器为 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喘息阿梅尔安装G ++ 4.9?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!