MSYS:错误c编译器无法创建可执行文件

时间:2012-06-16 21:47:35

标签: c mingw libxml2

我正在this教程之后尝试在MinGW上构建libxml2。但是当我在MSYS终端上运行/.configure时,我得到:

 ./configure
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
/c/Users/name/Documents/libxml2-2.4.25-special/missing: Unknown `--run' option
Try `/c/Users/name/Documents/libxml2-2.4.25-special/missing --help' for more i                                             nformation
configure: WARNING: `missing' script is too old or missing
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for gcc... gcc
checking for C compiler default output... configure: error: C compiler cannot create executables                                             eate executables
check `config.log' for details.

我试过在libxml2目录上设置755,但没有改变。

如何解决这个问题?

编辑 config.log文件:

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

It was created by configure, which was
generated by GNU Autoconf 2.54.  Invocation command line was

  $ ./configure 

## --------- ##
## Platform. ##
## --------- ##

hostname = username-PC
uname -m = i686
uname -r = 1.0.9(0.46/3/2)
uname -s = MINGW32_NT-6.1
uname -v = 2003-07-03 07:26

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
hostinfo               = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: .
PATH: /usr/local/bin
PATH: /mingw/bin
PATH: /bin
PATH: /c/Program Files/Common Files/Microsoft Shared/Windows Live
PATH: /c/Windows/system32
PATH: /c/Windows/System32/WindowsPowerShell/v1.0/
PATH: /c/Program Files/CodeBlocks/MinGW/bin
PATH: /c/Program Files/CodeBlocks/MinGW/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:1491: checking build system type
configure:1509: result: i686-pc-mingw32
configure:1517: checking host system type
configure:1531: result: i686-pc-mingw32
configure:1570: checking for a BSD-compatible install
configure:1624: result: /bin/install -c
configure:1635: checking whether build environment is sane
configure:1678: result: yes
configure:1703: WARNING: `missing' script is too old or missing
configure:1711: checking for gawk
configure:1727: found /bin/gawk
configure:1737: result: gawk
configure:1747: checking whether make sets ${MAKE}
configure:1767: result: yes
configure:1966: checking for gcc
configure:1982: found /mingw/bin/gcc
configure:1992: result: gcc
configure:2234: checking for C compiler version
configure:2237: gcc --version </dev/null >&5
gcc.exe (GCC) 4.7.0
Copyright (C) 2012 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:2240: $? = 0
configure:2242: gcc -v </dev/null >&5
Using built-in specs.
COLLECT_GCC=C:\mingw\bin\gcc.exe
Target: mingw32
Configured with: ../gcc-4.7.0/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --disable-build-poststage1-with-cxx --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.7.0 (GCC) 
configure:2245: $? = 0
configure:2247: gcc -V </dev/null >&5
gcc.exe: error: unrecognized command line option '-V'
gcc.exe: fatal error: no input files
compilation terminated.
configure:2250: $? = 1
configure:2270: checking for C compiler default output
configure:2273: gcc    conftest.c  >&5
gcc.exe: error: CreateProcess: No such file or directory
configure:2276: $? = 1
configure: failed program was:
#line 2253 "configure"
#include "confdefs.h"

int
main ()
{

  ;
  return 0;
}
configure:2303: error: C compiler cannot create executables
check `config.log' for details.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=i686-pc-mingw32
ac_cv_build_alias=i686-pc-mingw32
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=
ac_cv_env_FFLAGS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=i686-pc-mingw32
ac_cv_host_alias=i686-pc-mingw32
ac_cv_path_install='/bin/install -c'
ac_cv_prog_AWK=gawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='aclocal-1.6'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='tar'
ANSI2KNR=''
AS=''
AUTOCONF='autoconf'
AUTOHEADER='autoheader'
AUTOMAKE='automake-1.6'
AWK='gawk'
C14N_OBJ=''
CATALOG_OBJ=''
CC='gcc'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS=''
DEBUG_OBJ=''
DEFS=''
DEPDIR=''
DLLTOOL=''
DOCB_OBJ=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
F77=''
FFLAGS=''
FTP_OBJ=''
HAVE_ISINF=''
HAVE_ISNAN=''
HTML_DIR=''
HTML_OBJ=''
HTTP_OBJ=''
ICONV_LIBS=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIBXML_MAJOR_VERSION='2'
LIBXML_MICRO_VERSION='25'
LIBXML_MINOR_VERSION='4'
LIBXML_VERSION='2.4.25'
LIBXML_VERSION_INFO='6:25:4'
LIBXML_VERSION_NUMBER='20425'
LN_S=''
LTLIBOBJS=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO='makeinfo'
MV=''
M_LIBS=''
OBJDUMP=''
OBJEXT=''
PACKAGE='libxml2'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PYTHON=''
PYTHON_INCLUDES=''
PYTHON_SITE_PACKAGES=''
PYTHON_SUBDIR=''
PYTHON_VERSION=''
RANLIB=''
RDL_LIBS=''
RM=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
TAR=''
TEST_REGEXPS=''
TEST_SCHEMAS=''
TEST_THREADS=''
THREAD_CFLAGS=''
THREAD_LIBS=''
U=''
VERSION='2.4.25-special'
WIN32_EXTRA_LDFLAGS=''
WIN32_EXTRA_LIBADD=''
WITH_C14N=''
WITH_CATALOG=''
WITH_DEBUG=''
WITH_DOCB=''
WITH_FTP=''
WITH_HTML=''
WITH_HTTP=''
WITH_ICONV=''
WITH_MEM_DEBUG=''
WITH_PYTHON_FALSE=''
WITH_PYTHON_TRUE=''
WITH_REGEXPS=''
WITH_SCHEMAS=''
WITH_THREADS=''
WITH_TRIO=''
WITH_TRIO_SOURCES_FALSE=''
WITH_TRIO_SOURCES_TRUE=''
WITH_XINCLUDE=''
WITH_XPATH=''
WITH_XPTR=''
XINCLUDE_OBJ=''
XML_CFLAGS=''
XML_INCLUDEDIR=''
XML_LIBDIR=''
XML_LIBS=''
XPATH_OBJ=''
XPTR_OBJ=''
Z_CFLAGS=''
Z_LIBS=''
ac_ct_AS=''
ac_ct_CC='gcc'
ac_ct_CXX=''
ac_ct_DLLTOOL=''
ac_ct_F77=''
ac_ct_OBJDUMP=''
ac_ct_RANLIB=''
ac_ct_STRIP=''
am__include=''
am__quote=''
bindir='${exec_prefix}/bin'
build='i686-pc-mingw32'
build_alias=''
build_cpu='i686'
build_os='mingw32'
build_vendor='pc'
datadir='${prefix}/share'
exec_prefix='NONE'
host='i686-pc-mingw32'
host_alias=''
host_cpu='i686'
host_os='mingw32'
host_vendor='pc'
includedir='${prefix}/include'
infodir='${prefix}/info'
install_sh='/c/Users/name/Documents/libxml2-2.4.25-special/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE "libxml2"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define VERSION "2.4.25-special"

configure: exit 77

1 个答案:

答案 0 :(得分:3)

解决方案:

问题在于我安装的新MinGW版本(4.7)。此版本版本不为我编译任何C代码。然后,当MSYS安装问“你安装了mingw吗?”我输入:“n”。因此,通过使用较旧的gcc版本,我能够编译C程序,然后运行./configuremake文件。