我尝试在 Ubuntu 14.04 上安装 gcc-4.5 和 g++-4.5
sudo apt-get install gcc-4.5 g++-4.5 gcc-multilib g++-multilib
但出现以下错误:
Package gcc-4.5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Package g++-4.5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'gcc-4.5' has no installation candidate
E: Package 'g++-4.5' has no installation candidate
谁能告诉我我需要做什么?
gcc-4.5 或 g++4.5 不在大多数 Ubuntu 软件发行版中。如果您想确切地获得此版本,请参阅 gccreleases 和 successful builds。
另一个选择是使用“PPA for Ubuntu Toolchain Uploads (restricted)”团队的版本。根据您的情况,添加
deb http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu trusty main
deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu trusty main
到您的源列表,然后运行
sudo apt-get update
。您将能够使用 sudo apt-get install gcc-4.5
。