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

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

概述我正在尝试为litecoins配置cpuminer而且我得到了 checking whether the C compiler works... noconfigure: error: in `/home/username/cpuminer-2.2.3':configure: error: C compiler cannot create executablesSee `config.log 我正在尝试为litecoins配置cpuminer而且我得到了
checking whether the C compiler works... noconfigure: error: in `/home/username/cpuminer-2.2.3':configure: error: C compiler cannot create executablesSee `config.log' for more details

这是在Ubuntu 12.04 x64上.

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

config.log的输出是

This file contains any messages produced by compilers whilerunning configure,to aID deBUGging if configure makes a mistake.It was created by cpuminer configure 2.2.3,which wasgenerated by GNU autoconf 2.68.  Invocation command line was  $./configure CFLAGS=-03## --------- #### Platform. #### --------- ##hostname = comancheuname -m = x86_64uname -r = 3.5.0-27-genericuname -s = linuxuname -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          = unkNownPATH: /usr/local/sbinPATH: /usr/local/binPATH: /usr/sbinPATH: /usr/binPATH: /sbinPATH: /bin## ----------- #### Core tests. #### ----------- ##configure:2300: checking build system typeconfigure:2314: result: x86_64-unkNown-linux-gnuconfigure:2334: checking host system typeconfigure:2347: result: x86_64-unkNown-linux-gnuconfigure:2367: checking target system typeconfigure:2380: result: x86_64-unkNown-linux-gnuconfigure:2424: checking for a BSD-compatible installconfigure:2492: result: /usr/bin/install -cconfigure:2503: checking whether build environment is saneconfigure:2553: result: yesconfigure:2694: checking for a thread-safe mkdir -pconfigure:2733: result: /bin/mkdir -pconfigure:2746: checking for gawkconfigure:2776: result: noconfigure:2746: checking for mawkconfigure:2762: found /usr/bin/mawkconfigure:2773: result: mawkconfigure:2784: checking whether make sets $(MAKE)configure:2806: result: yesconfigure:2890: checking whether to enable maintainer-specific portions of Makefilesconfigure:2899: result: noconfigure:2925: checking for style of include used by makeconfigure:2953: result: GNUconfigure:3024: checking for gccconfigure:3040: found /usr/bin/gccconfigure:3051: result: gccconfigure:3280: checking for C compiler versionconfigure:3289: gcc --version >&5gcc (Ubuntu/linaro 4.7.2-2ubuntu1) 4.7.2copyright (C) 2012 Free Software Foundation,Inc.This is free software; see the source for copying conditions.  There is NOwarranty; not even for MERCHANTABIliTY or fitness FOR A PARTIculaR PURPOSE.configure:3300: $? = 0configure:3289: gcc -v >&5Using built-in specs.ColLECT_GCC=gccColLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapperTarget: x86_64-linux-gnuConfigured 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-gnuThread model: posixgcc version 4.7.2 (Ubuntu/linaro 4.7.2-2ubuntu1) configure:3300: $? = 0configure:3289: gcc -V >&5gcc: error: unrecognized command line option '-V'gcc: Fatal error: no input filescompilation terminated.configure:3300: $? = 4configure:3289: gcc -qversion >&5gcc: error: unrecognized command line option '-qversion'gcc: Fatal error: no input filescompilation terminated.configure:3300: $? = 4configure:3320: checking whether the C compiler worksconfigure:3342: gcc -03   conftest.c  >&5gcc: error: unrecognized command line option '-03'configure:3346: $? = 1configure:3384: result: noconfigure: 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 executablesSee `config.log' for more details## ---------------- #### Cache variables. #### ---------------- ##ac_cv_build=x86_64-unkNown-linux-gnuac_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=setac_cv_env_CFLAGS_value=-03ac_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-gnuac_cv_path_install='/usr/bin/install -c'ac_cv_path_mkdir=/bin/mkdirac_cv_prog_AWK=mawkac_cv_prog_ac_ct_CC=gccac_cv_prog_make_make_set=yesac_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,'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
解决方法 我在构建xz-5.0.5时遇到了与原始海报相同的问题.
这不是CFLAGS论证的问题. configure脚本试图验证编译器是否符合c99.
我需要添加CFLAGS选项–std = c99以使其能够在配置脚本中通过此检查:
./configure CC=gcc CFLAGS="--std=c99 -O3"
总结

以上是内存溢出为你收集整理的C编译器无法在Ubuntu 12.04中创建可执行文件全部内容,希望文章能够帮你解决C编译器无法在Ubuntu 12.04中创建可执行文件所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1236692.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-06
下一篇 2022-06-06

发表评论

登录后才能评论

评论列表(0条)

保存