2012-06-16 145 views
2

我正在尝试在012GCW教程之后在MinGW上构建libxml2。但是,当我MSYS终端上运行/.configure我得到:MSYS:错误c编译器无法创建可执行文件

./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 

UPDATE

+2

config.log是什么? – robert

+0

可能相关,但也许不是一个重复,因为这是Windows:http://stackoverflow.com/questions/1461703/autoconf-problem-error-c-compiler-cannot-create-executables?rq=1 – robert

+0

@robert:Updated用'config.log'文件。 – Jack

回答

3

解决办法:

的问题是,我会安装新版本的MinGW(4.7)。这个版本不是为我编译任何C代码。然后,当MSYS安装询问“您是否安装了mingw?”时,我键入:“n”。因此,通过使用旧版gcc版本,我能够编译C程序,然后运行./configuremake文件。

+0

什么版本的gcc为你工作? – Mark

+1

@Mark:我不记得这个版本了,但我认为它是3.x – Jack

相关问题