英文:
Linuxbrew: configure: error: could not find a working compiler
问题
在Ubuntu 16.04.7 LTS(xenial)上执行brew install
时,我遇到了以下错误,导致每次安装都失败:
检查是否启用Makefile的维护者特定部分... 否
检查ABI=64
检查编译器gcc-13 ... 否
检查ABI=x32
检查编译器gcc-13 ... 否
检查ABI=32
检查编译器gcc-13 ... 否
配置错误:无法找到可工作的编译器,请查看config.log以获取详细信息
英文:
When executing brew install
on Ubuntu 16.04.7 LTS (xenial) I am getting the following error which breaks each install:
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler gcc-13 ... no
checking ABI=x32
checking compiler gcc-13 ... no
checking ABI=32
checking compiler gcc-13 ... no
configure: error: could not find a working compiler, see config.log for details
答案1
得分: 0
- 通过执行以下命令创建一个测试文件:
echo 'int main(){}' > dummy.c
- 运行
gcc-13 dummy.c
,将会出现下面的错误(请注意,gcc dummy.c
可以正常工作):
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so: error loading plugin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so)
- 运行
brew link --force binutils
:
链接 /home/linuxbrew/.linuxbrew/Cellar/binutils/2.40.reinstall... 创建了 86 个符号链接。
如果您需要将此软件添加到 PATH 中,请考虑运行以下命令:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
- 然后按照建议运行:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
- 您现在可以选择性地通过运行
echo $PATH
来检查您的 PATH。 - 运行
brew config
:
HOMEBREW_VERSION: 4.0.28
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2b4cfb033757b63ab0b128d01c58db76480956f9
最后提交: 7 天前
Core tap JSON: 13 Jul 21:39 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_GITHUB_API_TOKEN: 已设置
HOMEBREW_MAKE_JOBS: 1
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: 单核 64 位 Haswell
Clang: 不适用
Git: 2.7.4 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 4.4.0-1160.80.1.vz7.191.4 x86_64 GNU/Linux
操作系统: Ubuntu 16.04.7 LTS (xenial)
主机 glibc: 2.23
/usr/bin/gcc: 5.4.0
/usr/bin/ruby: 2.3.1
glibc: 不适用
gcc@11: 不适用
gcc: 不适用
xorg: 不适用
- 现在
gcc-13 dummy.c
应该不会出现错误。 - 现在
brew install
应该也可以正常工作,不会出现任何错误。
英文:
- Create a test file by executing:
echo 'int main(){}' > dummy.c
- Run
gcc-13 dummy.c
which will give the error below (please note thatgcc dummy.c
can work just fine)
/usr/bin/ld: /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so: error loading plugin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /home/linuxbrew/.linuxbrew/Cellar/gcc/13.1.0/bin/../libexec/gcc/x86_64-pc-linux-gnu/13/liblto_plugin.so)
- Run
brew link --force binutils
Linking /home/linuxbrew/.linuxbrew/Cellar/binutils/2.40.reinstall... 86 symlinks created.
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
- Then as recommended run:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/binutils/bin:$PATH"' >> ~/.profile
- You can now optionally check your PATH by running:
echo $PATH
- Run
brew config
HOMEBREW_VERSION: 4.0.28
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2b4cfb033757b63ab0b128d01c58db76480956f9
Last commit: 7 days ago
Core tap JSON: 13 Jul 21:39 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_MAKE_JOBS: 1
Homebrew Ruby: 2.6.10 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.10_1/bin/ruby
CPU: single-core 64-bit haswell
Clang: N/A
Git: 2.7.4 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 4.4.0-1160.80.1.vz7.191.4 x86_64 GNU/Linux
OS: Ubuntu 16.04.7 LTS (xenial)
Host glibc: 2.23
/usr/bin/gcc: 5.4.0
/usr/bin/ruby: 2.3.1
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A
- Now
gcc-13 dummy.c
should give no error - And now the
brew install
should work without any error as well
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论