gcc 不起作用

gcc 不起作用

我在尝试编译 Wine 1.7.26 时遇到了 GCC 问题。

当我使用该./configure命令时,出现错误:C 编译器无法创建可执行文件,有关更多详细信息,请参阅“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 Wine configure 1.7.26, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure 

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

hostname = david-1001PX
uname -m = i686
uname -r = 3.16.0-12-generic
uname -s = Linux
uname -v = #18-Ubuntu SMP Mon Sep 1 13:04:08 UTC 2014

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

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

PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin


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

configure:3461: checking build system type
configure:3475: result: i686-pc-linux-gnu
configure:3495: checking host system type
configure:3508: result: i686-pc-linux-gnu
configure:3538: checking whether make sets $(MAKE)
configure:3560: result: yes
configure:3617: checking for gcc
configure:3633: found /usr/bin/gcc
configure:3644: result: gcc
configure:3873: checking for C compiler version
configure:3882: gcc --version >&5
gcc (Ubuntu 4.9.1-12ubuntu2) 4.9.1
Copyright (C) 2014 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:3893: $? = 0
configure:3882: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.9/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.1-12ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-i386 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-i386 --with-arch-directory=i386 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.9.1 (Ubuntu 4.9.1-12ubuntu2) 
configure:3893: $? = 0
configure:3882: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3893: $? = 4
configure:3882: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3893: $? = 4
configure:3913: checking whether the C compiler works
configure:3935: gcc    conftest.c  >&5
/usr/bin/ld: this linker was not configured to use sysroots
collect2: error: ld returned 1 exit status
configure:3939: $? = 1
configure:3977: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "Wine"
| #define PACKAGE_TARNAME "wine"
| #define PACKAGE_VERSION "1.7.26"
| #define PACKAGE_STRING "Wine 1.7.26"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL "http://www.winehq.org"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3982: error: in `/home/david/src/wine-1.7.26':
configure:3984: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_build=i686-pc-linux-gnu
ac_cv_env_CAPI20_CFLAGS_set=
ac_cv_env_CAPI20_CFLAGS_value=
ac_cv_env_CAPI20_LIBS_set=
ac_cv_env_CAPI20_LIBS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
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_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DBUS_CFLAGS_set=
ac_cv_env_DBUS_CFLAGS_value=
ac_cv_env_DBUS_LIBS_set=
ac_cv_env_DBUS_LIBS_value=
ac_cv_env_FONTCONFIG_CFLAGS_set=
ac_cv_env_FONTCONFIG_CFLAGS_value=
ac_cv_env_FONTCONFIG_LIBS_set=
ac_cv_env_FONTCONFIG_LIBS_value=
ac_cv_env_FREETYPE_CFLAGS_set=
ac_cv_env_FREETYPE_CFLAGS_value=
ac_cv_env_FREETYPE_LIBS_set=
ac_cv_env_FREETYPE_LIBS_value=
ac_cv_env_GNUTLS_CFLAGS_set=
ac_cv_env_GNUTLS_CFLAGS_value=
ac_cv_env_GNUTLS_LIBS_set=
ac_cv_env_GNUTLS_LIBS_value=
ac_cv_env_GPHOTO2_CFLAGS_set=
ac_cv_env_GPHOTO2_CFLAGS_value=
ac_cv_env_GPHOTO2_LIBS_set=
ac_cv_env_GPHOTO2_LIBS_value=
ac_cv_env_GPHOTO2_PORT_CFLAGS_set=
ac_cv_env_GPHOTO2_PORT_CFLAGS_value=
ac_cv_env_GPHOTO2_PORT_LIBS_set=
ac_cv_env_GPHOTO2_PORT_LIBS_value=
ac_cv_env_GSTREAMER_CFLAGS_set=
ac_cv_env_GSTREAMER_CFLAGS_value=
ac_cv_env_GSTREAMER_LIBS_set=
ac_cv_env_GSTREAMER_LIBS_value=
ac_cv_env_HAL_CFLAGS_set=
ac_cv_env_HAL_CFLAGS_value=
ac_cv_env_HAL_LIBS_set=
ac_cv_env_HAL_LIBS_value=
ac_cv_env_JPEG_CFLAGS_set=
ac_cv_env_JPEG_CFLAGS_value=
ac_cv_env_JPEG_LIBS_set=
ac_cv_env_JPEG_LIBS_value=
ac_cv_env_LCMS2_CFLAGS_set=
ac_cv_env_LCMS2_CFLAGS_value=
ac_cv_env_LCMS2_LIBS_set=
ac_cv_env_LCMS2_LIBS_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_MPG123_CFLAGS_set=
ac_cv_env_MPG123_CFLAGS_value=
ac_cv_env_MPG123_LIBS_set=
ac_cv_env_MPG123_LIBS_value=
ac_cv_env_PNG_CFLAGS_set=
ac_cv_env_PNG_CFLAGS_value=
ac_cv_env_PNG_LIBS_set=
ac_cv_env_PNG_LIBS_value=
ac_cv_env_SANE_CFLAGS_set=
ac_cv_env_SANE_CFLAGS_value=
ac_cv_env_SANE_LIBS_set=
ac_cv_env_SANE_LIBS_value=
ac_cv_env_TIFF_CFLAGS_set=
ac_cv_env_TIFF_CFLAGS_value=
ac_cv_env_TIFF_LIBS_set=
ac_cv_env_TIFF_LIBS_value=
ac_cv_env_XMKMF_set=
ac_cv_env_XMKMF_value=
ac_cv_env_XML2_CFLAGS_set=
ac_cv_env_XML2_CFLAGS_value=
ac_cv_env_XML2_LIBS_set=
ac_cv_env_XML2_LIBS_value=
ac_cv_env_XSLT_CFLAGS_set=
ac_cv_env_XSLT_CFLAGS_value=
ac_cv_env_XSLT_LIBS_set=
ac_cv_env_XSLT_LIBS_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-linux-gnu
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes

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

ALL_TEST_RESOURCES=''
ALL_VARS_RULES=''
ALSA_LIBS=''
APPKIT_LIBS=''
APPLICATIONSERVICES_LIBS=''
AR=''
ARFLAGS=''
BISON=''
BUILTINFLAG=''
CAPI20_CFLAGS=''
CAPI20_LIBS=''
CARBON_LIBS=''
CC='gcc'
CFLAGS=''
CONVERT=''
COREAUDIO_LIBS=''
COREFOUNDATION_LIBS=''
CORESERVICES_LIBS=''
CPP=''
CPPBIN=''
CPPFLAGS=''
CROSSCC=''
CROSSTARGET=''
CUPS_CFLAGS=''
CXX=''
CXXFLAGS=''
DBUS_CFLAGS=''
DBUS_LIBS=''
DEFS=''
DISKARBITRATION_LIBS=''
DLLFLAGS=''
DLLPREFIX=''
DLLTOOL=''
DL_LIBS=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
EXTRACFLAGS=''
FLEX=''
FONTCONFIG_CFLAGS=''
FONTCONFIG_LIBS=''
FONTFORGE=''
FORCEFEEDBACK_LIBS=''
FREETYPE_CFLAGS=''
FREETYPE_LIBS=''
GETTEXTPO_LIBS=''
GNUTLS_CFLAGS=''
GNUTLS_LIBS=''
GPHOTO2_CFLAGS=''
GPHOTO2_LIBS=''
GPHOTO2_PORT_CFLAGS=''
GPHOTO2_PORT_LIBS=''
GREP=''
GSTREAMER_CFLAGS=''
GSTREAMER_LIBS=''
HAL_CFLAGS=''
HAL_LIBS=''
ICOTOOL=''
IOKIT_LIBS=''
JPEG_CFLAGS=''
JPEG_LIBS=''
KSTAT_LIBS=''
LCMS2_CFLAGS=''
LCMS2_LIBS=''
LDAP_LIBS=''
LDCONFIG=''
LDD=''
LDFLAGS=''
LDRPATH_INSTALL=''
LDRPATH_LOCAL=''
LIBOBJS=''
LIBPCAP=''
LIBS=''
LIBWINE_RULES=''
LINGUAS=''
LN_S=''
LOADER_RULES=''
LTLIBOBJS=''
MPG123_CFLAGS=''
MPG123_LIBS=''
MSGFMT=''
OBJEXT=''
OPENAL_LIBS=''
OPENCL_LIBS=''
OPENGL_LIBS=''
OSS4_CFLAGS=''
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_NAME='Wine'
PACKAGE_STRING='Wine 1.7.26'
PACKAGE_TARNAME='wine'
PACKAGE_URL='http://www.winehq.org'
PACKAGE_VERSION='1.7.26'
PATH_SEPARATOR=':'
PKG_CONFIG=''
PNG_CFLAGS=''
PNG_LIBS=''
POLL_LIBS=''
PRELINK=''
PROCSTAT_LIBS=''
PTHREAD_LIBS=''
QUICKTIME_LIBS=''
RANLIB=''
READELF=''
RESOLV_LIBS=''
RSVG=''
RT_LIBS=''
SANE_CFLAGS=''
SANE_LIBS=''
SECURITY_LIBS=''
SET_MAKE=''
SHELL='/bin/bash'
SOCKET_LIBS=''
STRIP=''
TARGETFLAGS=''
TIFF_CFLAGS=''
TIFF_LIBS=''
TOOLSDIR=''
TOOLSEXT=''
UNWINDFLAGS=''
XMKMF=''
XML2_CFLAGS=''
XML2_LIBS=''
XSLT_CFLAGS=''
XSLT_LIBS=''
X_CFLAGS=''
X_EXTRA_LIBS=''
X_LIBS=''
X_PRE_LIBS=''
Z_LIBS=''
ac_ct_AR=''
ac_ct_CC='gcc'
ac_ct_CXX=''
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_cpu='i686'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
dlldir=''
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='i686-pc-linux-gnu'
host_alias=''
host_cpu='i686'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

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

/* confdefs.h */
#define PACKAGE_NAME "Wine"
#define PACKAGE_TARNAME "wine"
#define PACKAGE_VERSION "1.7.26"
#define PACKAGE_STRING "Wine 1.7.26"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_URL "http://www.winehq.org"

configure: exit 77

有人知道该如何解决这个问题吗?

答案1

关键错误消息是这样的:

/usr/bin/ld: this linker was not configured to use sysroots

这表明 gcc 和 ld 之间不匹配。

您可能需要安装的更新版本binutils(通常包含的软件包/usr/bin/ld),以匹配您正在使用的 gcc 版本。

相关内容