gpt4 book ai didi

c++ - 在 Cygwin 中处理 "C compiler cannot create executables"

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:41:18 26 4
gpt4 key购买 nike

无论我尝试在 Cygwin 中编译什么,我都会得到以下输出:

checking for mingw32 environment... nochecking for EMX OS/2 environment... nochecking how to run the C preprocessor... gcc -Echecking for gcc... gccchecking whether the C compiler (gcc   ) works... noconfigure: error: installation or configuration problem: C compiler cannot create executables.

日志文件的最后几行如下所示:

configure:2810: checking for EMX OS/2 environmentconfigure:2822: gcc -c   conftest.c 1>&5configure: In function `main':configure:2818: error: `__EMX__' undeclared (first use in this function)configure:2818: error: (Each undeclared identifier is reported only onceconfigure:2818: error: for each function it appears in.)configure: failed program was:#line 2815 "configure"#include "confdefs.h"int main() {return __EMX__;; return 0; }configure:2838: checking how to run the C preprocessorconfigure:2859: gcc -E  conftest.c >/dev/null 2>conftest.outconfigure:2943: checking for gccconfigure:3056: checking whether the C compiler (gcc   ) worksconfigure:3072: gcc -o conftest    conftest.c -llib 1>&5/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld: cannot find -llibcollect2: ld returned 1 exit statusconfigure: failed program was:#line 3067 "configure"#include "confdefs.h"main(){return(0);}

这是一个全新的 Cygwin 安装,其中添加了 G++ 和许多其他开发工具。知道我需要做什么才能让这个东西工作吗?

更新 0:Nick,您指向 http://www.geektimes.com/linux/troubleshooting/c-cant-create-executables.html 的链接已经尝试过 - 不幸的是,此说明适用于 redhat,似乎不适用于 cygwin。

最佳答案

您的配置有误。通常 autoreconf -f 有帮助。如果不是,您需要检查失败的规则并修复它。

关于c++ - 在 Cygwin 中处理 "C compiler cannot create executables",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/461711/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com