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

在Windows/Cygwin环境配置Concorde TSP求解器时遭遇‘C编译器无法生成可执行文件’错误的求助

在Windows/Cygwin环境配置Concorde TSP求解器时遭遇‘C编译器无法生成可执行文件’错误的求助

各位好,我现在正尝试在Windows的Cygwin环境下安装Concorde TSP求解器,最终是为了在R的TSP包中使用它,但在配置阶段遇到了棘手的问题:运行configure脚本时,报错提示**“C compiler cannot create executables”**。

我已经完成了Cygwin的安装,并且按照相关指引在Cygwin中准备Concorde的配置环境,但执行以下命令时出现错误:

$ CC="gcc" CFLAGS="-g -O3" ./configure --host=i686-pc-cygwin

命令的完整输出如下:

loading cache ./config.cache

checking host system type... i686-pc-cygwin

checking for prespecified compiler options... yes

Using default CC:       gcc

Using default CPPFLAGS: -ansi -pedantic -Wall -W -Wtraditional -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs

Using default CFLAGS:   -g -O3

Using default LDFLAGS:

checking for gcc... gcc

checking whether the C compiler (gcc -g -O3 ) works... no

configure: error: installation or configuration problem: C compiler cannot create executables.

同时我也查看了config.log文件的相关内容,其中关键部分如下:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

configure:593: checking host system type

configure:619: checking for prespecified compiler options

configure:716: checking for gcc

configure:829: checking whether the C compiler (gcc -g -O3 ) works

configure:845: gcc -o conftest -g -O3 -ansi -pedantic -Wall -W -Wtraditional -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs  conftest.c  1>&5

configure: failed program was:
#line 840 "configure"
#include "confdefs.h"

main(){return(0);}

我之前也找到过一个类似问题的提问,但里面没有有效的解决方案,只是有人说自己的环境没遇到这个问题。

另外,我用cygcheck检查了配置编译Concorde所需的依赖包,结果显示这些包都已正常安装且版本是最新的:

$ cygcheck -c gcc-core make cygwin-devel

输出:

Cygwin Package Information

Package              Version        Status

cygwin-devel         3.4.8-1        OK

gcc-core             11.4.0-1       OK

make                 4.4.1-2        OK

我已经尝试过重装Cygwin,并且确保所有需要的包都安装了最新版本,但问题依然存在,希望有经验的朋友能帮我排查一下原因,谢谢!

备注:内容来源于stack exchange,提问作者mda2894

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.21 15:08:10