You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

编译配置报错:C编译器无法生成可执行文件,附config.log内容求助

Hey there, let's work through that configure error: C compiler cannot create executables problem together. This is a super common issue, and we can break down the fixes based on what usually pops up in config.log files:

1. First, make sure you actually have a C compiler installed

Most systems don't come with a compiler pre-installed. Here's how to grab one:

  • On Debian/Ubuntu-based distros: Run sudo apt install build-essential – this package bundles gcc, make, and all the basic tools you need for compiling.
  • On RHEL/CentOS/Fedora: Use sudo dnf install gcc make or sudo yum groupinstall "Development Tools" to get the full set.
  • Verify it worked by typing gcc --version into your terminal. If you see a version number, great! If not, your install failed – double-check your package manager's output for clues.
2. Install missing C standard library development files

Even with gcc installed, you might be missing the files needed to create basic executables. Look for lines in your config.log like error: cannot find crt1.o – that's a dead giveaway this is the issue.

  • On Debian/Ubuntu: Install libc6-dev with sudo apt install libc6-dev
  • On RHEL/CentOS: Grab glibc-devel using sudo dnf install glibc-devel
3. Check your environment variables

Sometimes wonky environment settings mess things up:

  • Run echo $CC – if this outputs something invalid (like a non-existent compiler path), reset it with export CC=gcc (or clang if you prefer using that compiler).
  • If you've set custom CFLAGS or LDFLAGS variables, they might be adding broken flags. Try unsetting them temporarily with unset CFLAGS LDFLAGS, then re-run ./configure to see if that fixes it.
4. Dig into the exact failure in config.log

Your config.log has the precise test that failed – look for sections starting with configure:XXXX: checking for C compiler output file name. You'll see something like:

configure:1234: gcc -o conftest conftest.c
configure:1238: $? = 1
configure:1276: error: in `/home/you/source-dir':
configure:1278: error: C compiler cannot create executables

The lines right after the test command (gcc -o conftest conftest.c) will tell you exactly what went wrong – maybe a missing library, permission error, or corrupted compiler. If you can share those specific lines, we can narrow it down even more!

5. Fix directory permission issues

If you're trying to compile in a folder where you don't have write access, the test executable can't be created. Make sure you own the source directory or have read/write permissions there. And avoid using sudo to run ./configure unless you absolutely have to – compiling as root can cause weird permission problems later on.

内容的提问来源于stack exchange,提问作者Jessica

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 10:11:03