如何在 ubuntu 上安装新版本的 gcc

发布于 2024-08-30 09:33:34 字数 106 浏览 4 评论 0原文

我使用的是 ubuntu 9.10,它附带 gcc 4.4。 如何安装 gcc 4.5 而不搞砸我的 gcc 4.4。环境。我只需要 gcc 4.5 来编译 1 个应用程序。

谢谢。

I am using ubuntu 9.10 and it comes with gcc 4.4.
How can I install gcc 4.5 without screwing up my gcc 4.4. environment. I just need gcc 4.5 to compile 1 application.

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

雨夜星沙 2024-09-06 09:33:34

我的首选方法是在 /etc/apt/sources.list 中有一个 deb-src 条目,例如

# Debian sources
deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free

我可以执行 apt-get source foo code> 并获取适当的包及其将被解包的源。我通常添加一个本地变更日志条目(由修订号分隔为 1.2-3local0)并重建。这有时需要构建依赖关系。这一切都取决于...

我猜 gcc-4.5 目前处于实验阶段 根据此页面 因此您还必须将实验添加到 sources.list 文件中。我没有使用过这个,但它应该也能工作:

deb-src http://ftp.debian.org/debian experimental main

My preferred method is to have a deb-src entry in /etc/apt/sources.list as e.g.

# Debian sources
deb-src http://ftp.us.debian.org/debian/ unstable main contrib non-free

I can then do apt-get source foo and fetch the appropriate package with its sources which will be unpackages. I typically add a local changelog entry (set apart by a revision number as 1.2-3local0) and rebuild. This sometimes entails building dependencies. It all depends...

I guess gcc-4.5 is currently in experimental as per this page so you would have to add experimental to the sources.list file as well. I have not used this but it should work too:

deb-src http://ftp.debian.org/debian experimental main
音盲 2024-09-06 09:33:34

最简单的方法是安装到私有前缀中:

configure --prefix=/some/private/prefix   ...

在私有前缀中,您覆盖现有文件的机会为零。然后,您需要将前缀添加到您的路径中。

第二种选择是给新的二进制文件一个后缀并使用特定于版本的运行时库:

configure --program-suffix=-4.5.0 --enable-version-specific-runtime-libs

尽管我不能保证其他文件不会被修改。

The easiest way is to install into a private prefix:

configure --prefix=/some/private/prefix   ...

In a private prefix, there is 0 chance you'll overwrite an existing file. You'll then need to add the prefix to your path.

A second option is to give the new binaries a suffix and to use version specific runtime libraries:

configure --program-suffix=-4.5.0 --enable-version-specific-runtime-libs

although I can't promise some other file won't be modified.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文