Compiler errors mingw给出错误-C编译器无法创建可执行文件

Compiler errors mingw给出错误-C编译器无法创建可执行文件,compiler-errors,mingw,mingw-w64,Compiler Errors,Mingw,Mingw W64,我正在尝试在Windows 7 64位操作系统上编译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

我正在尝试在Windows 7 64位操作系统上编译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.
configure:3056:检查gcc
配置:3072:found/mingw/bin/gcc
配置:3083:结果:gcc
配置:3312:检查C编译器版本
配置:3321:gcc--版本>&5
gcc.exe(gcc)4.5.4 20110822(预发布)
版权所有(C)2010免费软件基金会。
这是自由软件;有关复制条件,请参见源。没有
担保甚至不是为了适销性或适合某一特定目的。
配置:3332:$?=0
配置:3321:gcc-v>&5
使用内置规格。
COLLECT\u GCC=c:\mingw\bin\GCC.exe
目标:x86_64-w64-mingw32
配置为:../../../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完全动态字符串--禁用多库
线程模型:win32
gcc版本4.5.4 20110822(预发布)(gcc)
配置:3332:$?=0
配置:3321:gcc-V>&5
gcc.exe:“-V”选项必须具有参数
配置:3332:$?=1.
配置:3321:gcc-qversion>&5
gcc.exe:无法识别的选项'-qversion'
gcc.exe:没有输入文件
配置:3332:$?=1.
配置:3354:检查C编译器的默认输出文件名
配置:3376:gcc conftest.c>&5
gcc.exe:CreateProcess:没有这样的文件或目录
配置:3380:$?=1.
配置:3417:结果:
配置:失败的程序是:
|/*confdefs.h*/
|#定义包_名称“libgpg错误”
|#定义包_TARNAME“libgpg错误”
|#定义软件包_版本“1.10”
|#定义包_字符串“libgpg错误1.10”
|#定义包_BUGREPORT“bug”-gnupg@gnupg.org"
|#定义程序包_URL“”
|#定义包“libgpg错误”
|#定义版本“1.10”
|/*end CONDEFS.h*/
|#包括
|int
|主要()
| {
|文件*f=fopen(“conftest.out”,“w”);
|返回ferror(f)| fclose(f)!=0;
|
|   ;
|返回0;
| }
配置:3423:错误:在“/libgpg-error-1.10/libgpg-error-1.10”中:
配置:3427:错误:C编译器无法创建可执行文件
有关详细信息,请参阅“config.log”。

我该如何解决这个问题?我只需要libgrcrypt.lib文件,这样我就可以在我的项目中使用它们了

看来您的路径是错误的,gcc找不到它的一些帮助程序,如下所示:

 gcc.exe: CreateProcess: No such file or directory

尝试在用于配置的同一个shell中使用简单的测试程序运行gcc,并且使用相同的路径设置,它很可能会失败。您可以通过向路径中添加一些目录(如/mingw/bin)来修复此问题。但是,更有可能的情况是,您的gcc安装不完整,或者某些路径已硬编码,然后安装在其他位置。

谢谢!我可以通过更新路径来修复它。