The 4.1.* series had some issues. Even g++-4.2.1, the default on OS X, is not all that great. But you should definitely have the option of installing this.
When you do this, by all means go the package management route of installing proper dependencies. You will get matching packages for the other dependencies too.
In other words, you need to adjust /etc/apt/sources.list to point to an older release that had this version.
seems the straightforward solution to me. Since @DirkEddelbuettel noted that newer Ubuntu distributions dropped it, add an older distribution that has gcc-4.1 to your /etc/apt/sources.list. The Ubuntu people maintain a great website for looking that up; hardy, lucid and maverick seem great.
发布评论
评论(4)
很简单,只需从旧版 Ubuntu 版本的存档中获取即可。例如,我的机器(仍在运行 natty)有
4.1.* 系列有一些问题。即使 OS X 上的默认值 g++-4.2.1 也不是那么好。但您绝对应该可以选择安装它。
当您执行此操作时,请务必采用安装适当依赖项的包管理路径。您也将获得其他依赖项的匹配包。
换句话说,您需要调整
/etc/apt/sources.list
以指向具有此版本的旧版本。Easy, just take it from an archive of the older Ubuntu releases. For example, my machine (still running natty) has
The 4.1.* series had some issues. Even g++-4.2.1, the default on OS X, is not all that great. But you should definitely have the option of installing this.
When you do this, by all means go the package management route of installing proper dependencies. You will get matching packages for the other dependencies too.
In other words, you need to adjust
/etc/apt/sources.list
to point to an older release that had this version.对我来说似乎是简单的解决方案。由于 @DirkEddelbuettel 指出较新的 Ubuntu 发行版已删除它,因此请将具有 gcc-4.1 的较旧发行版添加到 /etc/apt/sources.list 中。 Ubuntu 人们维护了一个很棒的网站来查找它;坚强、清醒、特立独行看起来很棒。
seems the straightforward solution to me. Since @DirkEddelbuettel noted that newer Ubuntu distributions dropped it, add an older distribution that has gcc-4.1 to your /etc/apt/sources.list. The Ubuntu people maintain a great website for looking that up; hardy, lucid and maverick seem great.
应该这样做:
其他方法是下载 gcc 4.1.2 和依赖库,然后自己编译。
This should do :
Other way is to download gcc 4.1.2 and dependent libraries, and compile it yourself.
安装后查看其他版本:
使用 -V 标志运行特定版本:
Once installed see others:
Use the -V flag to run a particular version: