C编译器无法在Ubuntu 12.04中创建可执行文件

时间:2013-04-22 23:49:26

标签: c compiler-construction ubuntu-12.04

我正在尝试为litecoins配置cpuminer,我得到了

checking whether the C compiler works... no
configure: error: in `/home/username/cpuminer-2.2.3':
configure: error: C compiler cannot create executables
See `config.log' for more details

这是在Ubuntu 12.04 x64上。

我不确定会发生什么,但我已经运行了更新,并且我安装了gcc。我读了很多文章,但它们似乎指向了不同的东西。

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 cpuminer configure 2.2.3, which was
generated by GNU Autoconf 2.68.  Invocation command line was

  $ ./configure CFLAGS=-03

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

hostname = comanche
uname -m = x86_64
uname -r = 3.5.0-27-generic
uname -s = Linux
uname -v = #46-Ubuntu SMP Mon Mar 25 19:58:17 UTC 2013

/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:2300: checking build system type
configure:2314: result: x86_64-unknown-linux-gnu
configure:2334: checking host system type
configure:2347: result: x86_64-unknown-linux-gnu
configure:2367: checking target system type
configure:2380: result: x86_64-unknown-linux-gnu
configure:2424: checking for a BSD-compatible install
configure:2492: result: /usr/bin/install -c
configure:2503: checking whether build environment is sane
configure:2553: result: yes
configure:2694: checking for a thread-safe mkdir -p
configure:2733: result: /bin/mkdir -p
configure:2746: checking for gawk
configure:2776: result: no
configure:2746: checking for mawk
configure:2762: found /usr/bin/mawk
configure:2773: result: mawk
configure:2784: checking whether make sets $(MAKE)
configure:2806: result: yes
configure:2890: checking whether to enable maintainer-specific portions of Makefiles
configure:2899: result: no
configure:2925: checking for style of include used by make
configure:2953: result: GNU
configure:3024: checking for gcc
configure:3040: found /usr/bin/gcc
configure:3051: result: gcc
configure:3280: checking for C compiler version
configure:3289: gcc --version >&5
gcc (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2
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:3300: $? = 0
configure:3289: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-2ubuntu1' --    with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-    languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared     --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext     --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --    enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-    libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-    werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-    linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) 
configure:3300: $? = 0
configure:3289: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3300: $? = 4
configure:3289: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3300: $? = 4
configure:3320: checking whether the C compiler works
configure:3342: gcc -03   conftest.c  >&5
gcc: error: unrecognized command line option '-03'
configure:3346: $? = 1
configure:3384: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "cpuminer"
| #define PACKAGE_TARNAME "cpuminer"
| #define PACKAGE_VERSION "2.2.3"
| #define PACKAGE_STRING "cpuminer 2.2.3"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "cpuminer"
| #define VERSION "2.2.3"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3389: error: in `/home/username/cpuminer-2.2.3':
configure:3391: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_env_CCASFLAGS_set=
ac_cv_env_CCASFLAGS_value=
ac_cv_env_CCAS_set=
ac_cv_env_CCAS_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value=-03
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_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=x86_64-unknown-linux-gnu
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=mawk
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_make_make_set=yes
ac_cv_target=x86_64-unknown-linux-gnu

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

ACLOCAL='${SHELL} /home/username/cpuminer-2.2.3/missing --run aclocal-1.11'
ALLOCA=''
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
ARCH_x86_64_FALSE=''
ARCH_x86_64_TRUE=''
ARCH_x86_FALSE=''
ARCH_x86_TRUE=''
AUTOCONF='${SHELL} /home/username/cpuminer-2.2.3/missing --run autoconf'
AUTOHEADER='${SHELL} /home/username/cpuminer-2.2.3/missing --run autoheader'
AUTOMAKE='${SHELL} /home/username/cpuminer-2.2.3/missing --run automake-1.11'
AWK='mawk'
CC='gcc'
CCAS=''
CCASDEPMODE=''
CCASFLAGS=''
CCDEPMODE=''
CFLAGS='-03'
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
GREP=''
HAVE_WINDOWS_FALSE=''
HAVE_WINDOWS_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
JANSSON_LIBS=''
LDFLAGS=''
LIBCURL=''
LIBCURL_CPPFLAGS=''
LIBOBJS=''
LIBS=''
LTLIBOBJS=''
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='${SHELL} /home/username/cpuminer-2.2.3/missing --run makeinfo'
MKDIR_P='/bin/mkdir -p'
OBJEXT=''
PACKAGE='cpuminer'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='cpuminer'
PACKAGE_STRING='cpuminer 2.2.3'
PACKAGE_TARNAME='cpuminer'
PACKAGE_URL=''
PACKAGE_VERSION='2.2.3'
PATH_SEPARATOR=':'
PTHREAD_FLAGS=''
PTHREAD_LIBS=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
VERSION='2.2.3'
WANT_JANSSON_FALSE=''
WANT_JANSSON_TRUE=''
WS2_LIBS=''
_libcurl_config=''
ac_ct_CC='gcc'
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCCAS_FALSE=''
am__fastdepCCAS_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/username/cpuminer-2.2.3/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='/bin/mkdir -p'
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='x86_64-unknown-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux-gnu'
target_vendor='unknown'

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

/* confdefs.h */
#define PACKAGE_NAME "cpuminer"
#define PACKAGE_TARNAME "cpuminer"
#define PACKAGE_VERSION "2.2.3"
#define PACKAGE_STRING "cpuminer 2.2.3"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "cpuminer"
#define VERSION "2.2.3"

configure: exit 77

3 个答案:

答案 0 :(得分:17)

看起来gcc正在使用选项-03而不是-O3进行调用,从而导致错误输出。检查您指定的任何CFLAGS。

答案 1 :(得分:2)

我在构建xz-5.0.5时遇到了与原始海报相同的问题 这不是CFLAGS论证的问题。 configure脚本试图验证编译器是否符合c99 我需要添加CFLAGS选项 - std = c99 以使其能够在配置脚本中通过此检查:

./configure CC=gcc CFLAGS="--std=c99 -O3"

答案 2 :(得分:0)

它适用于我的情况:我将LIBS更改为CLIBS