compiler-errors - mingw提供错误-C编译器无法创建可执行文件

标签 compiler-errors mingw mingw-w64

我正在尝试在Windows 7 64位OS上编译libgpg-error-1.10,但是我遇到了以下错误-

checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/libgpg-error-1.10/libgpg-error-1.10':
configure: error: C compiler cannot create executables
See `config.log' for more details.

当我打开config.log文件时,可以看到以下相关行:
configure:3056: checking for gcc
configure:3072: found /mingw/bin/gcc
configure:3083: result: gcc
configure:3312: checking for C compiler version
configure:3321: gcc --version >&5
gcc.exe (GCC) 4.5.4 20110822 (prerelease)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3332: $? = 0
configure:3321: gcc -v >&5
Using built-in specs.
COLLECT_GCC=c:\mingw\bin\gcc.exe
Target: x86_64-w64-mingw32
Configured with: ../../../build/gcc/src/configure --target=x86_64-w64-mingw32 --prefix=/c/bb/vista64-mingw32/mingw-x86-x86_64
/build/build/root --with-sysroot=/c/bb/vista64-mingw32/mingw-x86-x86_64/build/build/root --enable-languages=all,obj-c++ --ena
ble-fully-dynamic-string --disable-multilib
Thread model: win32
gcc version 4.5.4 20110822 (prerelease) (GCC)
configure:3332: $? = 0
configure:3321: gcc -V >&5
gcc.exe: '-V' option must have argument
configure:3332: $? = 1
configure:3321: gcc -qversion >&5
gcc.exe: unrecognized option '-qversion'
gcc.exe: no input files
configure:3332: $? = 1
configure:3354: checking for C compiler default output file name
configure:3376: gcc    conftest.c  >&5
gcc.exe: CreateProcess: No such file or directory
configure:3380: $? = 1
configure:3417: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "libgpg-error"
| #define PACKAGE_TARNAME "libgpg-error"
| #define PACKAGE_VERSION "1.10"
| #define PACKAGE_STRING "libgpg-error 1.10"
| #define PACKAGE_BUGREPORT "bug-gnupg@gnupg.org"
| #define PACKAGE_URL ""
| #define PACKAGE "libgpg-error"
| #define VERSION "1.10"
| /* end confdefs.h.  */
| #include <stdio.h>
| int
| main ()
| {
| FILE *f = fopen ("conftest.out", "w");
|  return ferror (f) || fclose (f) != 0;
|
|   ;
|   return 0;
| }
configure:3423: error: in `/libgpg-error-1.10/libgpg-error-1.10':
configure:3427: error: C compiler cannot create executables
See `config.log' for more details.

有什么想法可以解决这个问题吗?我只需要libgrcrypt .lib文件,以便可以在项目中使用它们

最佳答案

看来您的PATH错误,并且gcc找不到其某些帮助程序,如以下所示:

 gcc.exe: CreateProcess: No such file or directory

尝试在用于配置的同一Shell中使用简单的测试程序运行gcc,并使用相同的PATH设置,它很可能会失败。您可能可以通过将一些目录(例如/mingw/bin)添加到PATH来修复它。但是,更有可能的是,您的gcc安装不完整或具有一些硬编码的路径,然后将其安装在其他位置。

关于compiler-errors - mingw提供错误-C编译器无法创建可执行文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7831578/

相关文章:

c++ - 如何在 C++ 中修复 "no match for operator+"?

java - 编辑.java文件并重新编译

java - 使用 Gradle 在 Java 之前/与 Java 一起编译 Scala

c++ - 自制删除如果是空间

c++ - mingw 非常非常简单的代码,报告对XXX的 undefined reference

c++ - MinGW-w64 g++ 是否公开了 Microsoft ucrt 对 C11 `getenv_s` 函数的实现?如果是,要包含什么标题?

c++ - CMake 3.8.0 在 makefile 中生成错误的链接命令

java - 无法将我的 DefaultListModel 分配给 Java NetBeans 中的 JList

c - 如何在 Linux 上为 Windows 交叉编译 C SDL 程序?

windows - 为什么 "MINGW64"出现在我的 Git bash 上?