gcc 不工作 - Xcode 3.2.6 - 雪豹

发布于 2024-12-23 21:31:37 字数 14283 浏览 3 评论 0 原文

我在搞乱我的环境方面有点新手,而且我似乎已经破坏了它。非常感谢您提供的任何帮助。

主要症状是,当尝试运行 rvm install 1.9.3 时,我得到以下跟踪:

Installing Ruby from source to: /Users/duncanstuart/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...

ruby-1.9.3-p0 - #fetching 
ruby-1.9.3-p0 - #extracted to /Users/duncanstuart/.rvm/src/ruby-1.9.3-p0 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/duncanstuart/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/duncanstuart/.rvm/src
Configuring yaml in /Users/duncanstuart/.rvm/src/yaml-0.1.4.
ERROR: Error running ' ./configure --prefix="/Users/duncanstuart/.rvm/usr"  ', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/configure.log
Compiling yaml in /Users/duncanstuart/.rvm/src/yaml-0.1.4.
ERROR: Error running 'make ', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/make.log
Installing yaml to /Users/duncanstuart/.rvm/usr
ERROR: Error running 'make install', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/make.install.log
ruby-1.9.3-p0 - #configuring 
ERROR: Error running ' ./configure --prefix=/Users/duncanstuart/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/duncanstuart/.rvm/usr ', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/configure.log
ERROR: There has been an error while running configure. Halting the installation.

yaml/configure.log 的内容如下:

[2012-01-04 02:06:11]  ./configure --prefix="/Users/duncanstuart/.rvm/usr"  
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/duncanstuart/.rvm/src/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

我怀疑密钥行是:

checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no

yaml/make.logyaml/make.install.log 的内容是相同的(当然除了前几行)

内容包含 config.log 文件在这个问题的末尾(因为它很长!)。重要的一行似乎是:

`ld: library not found for -lcrt1.10.6.o`

当使用任何其他版本的 ruby​​ 运行 rvm install ... 时,或者尝试使用 Homebrew 安装某些内容时,例如 brew install wget 时,我都会遇到相同的错误code>

我的理论

我怀疑这与错误地卸载和重新安装 Xcode 3.2.6 有关 - 请参阅下面的历史记录以获取我所做的完整详细信息。

我看过大量的 stackoverflow 帖子,但似乎没有一个回答这个问题:

我的设置

  • 我正在运行 Snow Leopard 10.6.8
  • 我尝试在 1 月 3 日安装 Xcode 3.2.6,我认为它成功了
  • 我已经安装了 rvm 1.10.0(撰写本文时的最新版本)
  • 以下几行位于 /usr/local/bin 中:

    lrwxr-xr-x 1 root 7 1月3日02:42 /usr/bin/gcc ->海湾合作委员会-4.0
    -rwxr-xr-x 1 root 93072 2007 年 9 月 23 日 /usr/bin/gcc-4.0
    -rwxr-xr-x 1 root 166128 2010 年 10 月 24 日 /usr/bin/gcc-4.2
    

如果您的建议是“升级到 Lion 并安装最新的 Xcode”,那就这样吧。

历史

以下是我遵循的步骤:我不确定什么是相关的,所以我将全部列出。

  1. 我有一个 rvm 的工作实例,它能够成功安装 ruby​​ 1.9.2 之前的所有内容。我相信我使用的是 Xcode 3.2.6,
  2. 我安装了 ma​​cports - 我不记得为什么了。
  3. 我最近由于某种原因安装了 Homebrew
  4. 当尝试运行 rvm install 1.9.3 时,我收到了一个错误,我认为与此类似:< /p>

    openssl_missing.h:173:错误:“BN_rand_range”的类型冲突
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:411:错误:之前的“BN_rand_range”声明位于此处
    openssl_missing.h:177:错误:“BN_pseudo_rand_range”的类型冲突
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:412:错误:之前的“BN_pseudo_rand_range”声明位于此处
    openssl_missing.c:270:错误:“BN_rand_range”的类型冲突
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:411:错误:之前的“BN_rand_range”声明位于此处
    openssl_missing.c:278:错误:“BN_pseudo_rand_range”的类型冲突
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:412:错误:之前的“BN_pseudo_rand_range”声明位于此处
    
  5. 谷歌搜索表明这是某种冲突,其中机器上有两个 openssl 的定义(据我所知)。

  6. 记住 Homebrew 有一个关于冲突的警告 对于MacPorts,我尝试使用说明卸载MacPorts 在Macports上 维基百科。 我还从我的文件中删除了与 MacPorts 相关的大量行 .bash_profile

  7. 这不起作用,因为我根本不明白我在做什么,我使用 sudo /Library/uninstall-devtools 卸载了 Xcode - -mode=all.

  8. 这当然会让事情变得更糟并导致上面显示的错误。因此,我从原始 CD 中重新安装了 Xcode - 结果是 Xcode 3.0

  9. 这并没有消除这些错误,因此我尝试卸载该版本的 Xcode - 不幸的是,这需要按照此处

  10. 最后我下载并安装了 Xcode 3.2.6(最新的可用的 Xcode对于 Snow Leopard?),并且已经没有想法了。

config.log

这是 config.log 文件的内容 - 位于 /Users/duncanstuart/.rvm/src/yaml-0.1.4/

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

It was created by yaml configure 0.1.4, which was
generated by GNU Autoconf 2.67.  Invocation command line was

  $ ./configure --prefix=/Users/duncanstuart/.rvm/usr CC=/usr/bin/gcc-4.2 --no-create --no-recursion

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

hostname = duncan-stuarts-macbook.local
uname -m = i386
uname -r = 10.8.0
uname -s = Darwin
uname -v = Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386

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

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 3.00 gigabytes
Default processor set: 95 tasks, 425 threads, 2 processors
Load average: 0.87, Mach factor: 1.12
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/duncanstuart/.rvm/usr/bin
PATH: /usr/local/bin
PATH: /usr/local/sbin
PATH: /usr/local/mysql/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/git/bin
PATH: /usr/X11/bin
PATH: /Users/duncanstuart/.rvm/bin
PATH: /usr/bin


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

configure:2409: checking for a BSD-compatible install
configure:2477: result: /usr/bin/install -c
configure:2488: checking whether build environment is sane
configure:2538: result: yes
configure:2679: checking for a thread-safe mkdir -p
configure:2718: result: config/install-sh -c -d
configure:2731: checking for gawk
configure:2761: result: no
configure:2731: checking for mawk
configure:2761: result: no
configure:2731: checking for nawk
configure:2761: result: no
configure:2731: checking for awk
configure:2747: found /usr/bin/awk
configure:2758: result: awk
configure:2769: checking whether make sets $(MAKE)
configure:2791: result: yes
configure:2947: checking for gcc
configure:2974: result: /usr/bin/gcc-4.2
configure:3203: checking for C compiler version
configure:3212: /usr/bin/gcc-4.2 --version >&5
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 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:3223: $? = 0
configure:3212: /usr/bin/gcc-4.2 -v >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
configure:3223: $? = 0
configure:3212: /usr/bin/gcc-4.2 -V >&5
gcc-4.2: argument to `-V' is missing
configure:3223: $? = 1
configure:3212: /usr/bin/gcc-4.2 -qversion >&5
i686-apple-darwin10-gcc-4.2.1: no input files
configure:3223: $? = 1
configure:3243: checking whether the C compiler works
configure:3265: /usr/bin/gcc-4.2    conftest.c  >&5
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
configure:3269: $? = 1
configure:3307: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "yaml"
| #define PACKAGE_TARNAME "yaml"
| #define PACKAGE_VERSION "0.1.4"
| #define PACKAGE_STRING "yaml 0.1.4"
| #define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component=libyaml"
| #define PACKAGE_URL ""
| #define PACKAGE "yaml"
| #define VERSION "0.1.4"
| #define YAML_VERSION_MAJOR 0
| #define YAML_VERSION_MINOR 1
| #define YAML_VERSION_PATCH 4
| #define YAML_VERSION_STRING "0.1.4"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3312: error: in `/Users/duncanstuart/.rvm/src/yaml-0.1.4':
configure:3314: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_env_CC_set=set
ac_cv_env_CC_value=/usr/bin/gcc-4.2
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_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_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=/usr/bin/gcc-4.2
ac_cv_prog_make_make_set=yes

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

ACLOCAL='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run aclocal-1.11'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run tar'
AR=''
AUTOCONF='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run autoconf'
AUTOHEADER='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run autoheader'
AUTOMAKE='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run automake-1.11'
AWK='awk'
CC='/usr/bin/gcc-4.2'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DOXYGEN=''
DOXYGEN_FALSE=''
DOXYGEN_TRUE=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run makeinfo'
MKDIR_P='config/install-sh -c -d'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='yaml'
PACKAGE_BUGREPORT='http://pyyaml.org/newticket?component=libyaml'
PACKAGE_NAME='yaml'
PACKAGE_STRING='yaml 0.1.4'
PACKAGE_TARNAME='yaml'
PACKAGE_URL=''
PACKAGE_VERSION='0.1.4'
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.1.4'
YAML_LT_AGE='0'
YAML_LT_CURRENT='2'
YAML_LT_RELEASE='0'
YAML_LT_REVISION='2'
ac_ct_CC='/usr/bin/gcc-4.2'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
lt_ECHO='/bin/echo'
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/config/install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/Users/duncanstuart/.rvm/usr'
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 "yaml"
#define PACKAGE_TARNAME "yaml"
#define PACKAGE_VERSION "0.1.4"
#define PACKAGE_STRING "yaml 0.1.4"
#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component=libyaml"
#define PACKAGE_URL ""
#define PACKAGE "yaml"
#define VERSION "0.1.4"
#define YAML_VERSION_MAJOR 0
#define YAML_VERSION_MINOR 1
#define YAML_VERSION_PATCH 4
#define YAML_VERSION_STRING "0.1.4"

configure: exit 77

I'm a bit of a novice at messing around with my environment and I seem to have rather broken it. Many thanks in advance for any assistance you can offer.

The main symptom is that when trying to run rvm install 1.9.3 I get the following trace:

Installing Ruby from source to: /Users/duncanstuart/.rvm/rubies/ruby-1.9.3-p0, this may take a while depending on your cpu(s)...

ruby-1.9.3-p0 - #fetching 
ruby-1.9.3-p0 - #extracted to /Users/duncanstuart/.rvm/src/ruby-1.9.3-p0 (already extracted)
Fetching yaml-0.1.4.tar.gz to /Users/duncanstuart/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/duncanstuart/.rvm/src
Configuring yaml in /Users/duncanstuart/.rvm/src/yaml-0.1.4.
ERROR: Error running ' ./configure --prefix="/Users/duncanstuart/.rvm/usr"  ', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/configure.log
Compiling yaml in /Users/duncanstuart/.rvm/src/yaml-0.1.4.
ERROR: Error running 'make ', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/make.log
Installing yaml to /Users/duncanstuart/.rvm/usr
ERROR: Error running 'make install', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/make.install.log
ruby-1.9.3-p0 - #configuring 
ERROR: Error running ' ./configure --prefix=/Users/duncanstuart/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/duncanstuart/.rvm/usr ', please read /Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/configure.log
ERROR: There has been an error while running configure. Halting the installation.

The contents of yaml/configure.log is as follows:

[2012-01-04 02:06:11]  ./configure --prefix="/Users/duncanstuart/.rvm/usr"  
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/duncanstuart/.rvm/src/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

I suspect the key lines are:

checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no

The contents of yaml/make.log and yaml/make.install.log are the same (except for the first couple of lines of course)

The contents of the config.log file are included at the end of this question (because it's very long!). The significant line seems to be:

`ld: library not found for -lcrt1.10.6.o`

I get the same errors when running rvm install ... with any other version of ruby, or when trying to install something with Homebrew e.g. brew install wget

My theory

I suspect this has got something to do with incorrectly uninstalling and reinstalling Xcode 3.2.6 - see History below for full details of what I've done.

I've had a look at a ton of stackoverflow posts, but none seem to answer this:

My Setup

  • I'm running Snow Leopard 10.6.8
  • I've tried to install Xcode 3.2.6 on 3rd Jan and I think it succeeded
  • I've got rvm 1.10.0 (the latest version at the time of writing)
  • The following lines are in /usr/local/bin:

    lrwxr-xr-x   1 root       7  3 Jan 02:42 /usr/bin/gcc -> gcc-4.0
    -rwxr-xr-x   1 root   93072 23 Sep  2007 /usr/bin/gcc-4.0
    -rwxr-xr-x   1 root  166128 24 Oct  2010 /usr/bin/gcc-4.2
    

If your advice is "upgrade to Lion and install the latest Xcode" then so be it.

History

Here are the steps which I've followed: I'm not sure what's relevant so I'll list it all.

  1. I had a working instance of rvm which was able to successfully install everything up to ruby 1.9.2. I believe I was using Xcode 3.2.6
  2. I had macports installed - I can't remember why.
  3. I had more recently installed Homebrew for some reason or other
  4. When trying to run rvm install 1.9.3 I got an error which I believe was similar to this:

    openssl_missing.h:173: error: conflicting types for ‘BN_rand_range’
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
    openssl_missing.h:177: error: conflicting types for ‘BN_pseudo_rand_range’
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here
    openssl_missing.c:270: error: conflicting types for ‘BN_rand_range’
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
    openssl_missing.c:278: error: conflicting types for ‘BN_pseudo_rand_range’
    /usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here
    
  5. Googling around suggested that this was some sort of conflict whereby there were two definitions of openssl on the machine (as far as I could understand).

  6. Remembering that there was a warning from Homebrew about conflicts
    with MacPorts, I tried to uninstall MacPorts using the instructions
    on the Macports
    Wiki
    .
    I also removed a load of lines related to MacPorts from my
    .bash_profile

  7. That didn't work and because I didn't understand at all what I was doing, I uninstalled Xcode with sudo <Xcode>/Library/uninstall-devtools --mode=all.

  8. This of course made matters worse and lead to the errors shown above. I therefore reinstalled Xcode from the original CD - this turned out to be Xcode 3.0.

  9. That didn't remove those errors so I tried to uninstall that version of Xcode - unfortunately this requires manually changing the system versions in the uninstall scripts as described here

  10. Finally I downloaded and installed Xcode 3.2.6 (the most recent Xcode available for Snow Leopard?) and have run out of ideas.

config.log

This is the contents of the config.log file - found in /Users/duncanstuart/.rvm/src/yaml-0.1.4/

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

It was created by yaml configure 0.1.4, which was
generated by GNU Autoconf 2.67.  Invocation command line was

  $ ./configure --prefix=/Users/duncanstuart/.rvm/usr CC=/usr/bin/gcc-4.2 --no-create --no-recursion

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

hostname = duncan-stuarts-macbook.local
uname -m = i386
uname -r = 10.8.0
uname -s = Darwin
uname -v = Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386

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

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = Mach kernel version:
     Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386
Kernel configured for up to 2 processors.
2 processors are physically available.
2 processors are logically available.
Processor type: i486 (Intel 80486)
Processors active: 0 1
Primary memory available: 3.00 gigabytes
Default processor set: 95 tasks, 425 threads, 2 processors
Load average: 0.87, Mach factor: 1.12
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /Users/duncanstuart/.rvm/usr/bin
PATH: /usr/local/bin
PATH: /usr/local/sbin
PATH: /usr/local/mysql/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /usr/local/git/bin
PATH: /usr/X11/bin
PATH: /Users/duncanstuart/.rvm/bin
PATH: /usr/bin


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

configure:2409: checking for a BSD-compatible install
configure:2477: result: /usr/bin/install -c
configure:2488: checking whether build environment is sane
configure:2538: result: yes
configure:2679: checking for a thread-safe mkdir -p
configure:2718: result: config/install-sh -c -d
configure:2731: checking for gawk
configure:2761: result: no
configure:2731: checking for mawk
configure:2761: result: no
configure:2731: checking for nawk
configure:2761: result: no
configure:2731: checking for awk
configure:2747: found /usr/bin/awk
configure:2758: result: awk
configure:2769: checking whether make sets $(MAKE)
configure:2791: result: yes
configure:2947: checking for gcc
configure:2974: result: /usr/bin/gcc-4.2
configure:3203: checking for C compiler version
configure:3212: /usr/bin/gcc-4.2 --version >&5
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)
Copyright (C) 2007 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:3223: $? = 0
configure:3212: /usr/bin/gcc-4.2 -v >&5
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
configure:3223: $? = 0
configure:3212: /usr/bin/gcc-4.2 -V >&5
gcc-4.2: argument to `-V' is missing
configure:3223: $? = 1
configure:3212: /usr/bin/gcc-4.2 -qversion >&5
i686-apple-darwin10-gcc-4.2.1: no input files
configure:3223: $? = 1
configure:3243: checking whether the C compiler works
configure:3265: /usr/bin/gcc-4.2    conftest.c  >&5
ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status
configure:3269: $? = 1
configure:3307: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "yaml"
| #define PACKAGE_TARNAME "yaml"
| #define PACKAGE_VERSION "0.1.4"
| #define PACKAGE_STRING "yaml 0.1.4"
| #define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component=libyaml"
| #define PACKAGE_URL ""
| #define PACKAGE "yaml"
| #define VERSION "0.1.4"
| #define YAML_VERSION_MAJOR 0
| #define YAML_VERSION_MINOR 1
| #define YAML_VERSION_PATCH 4
| #define YAML_VERSION_STRING "0.1.4"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3312: error: in `/Users/duncanstuart/.rvm/src/yaml-0.1.4':
configure:3314: error: C compiler cannot create executables
See `config.log' for more details

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

ac_cv_env_CC_set=set
ac_cv_env_CC_value=/usr/bin/gcc-4.2
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_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_path_install='/usr/bin/install -c'
ac_cv_prog_AWK=awk
ac_cv_prog_ac_ct_CC=/usr/bin/gcc-4.2
ac_cv_prog_make_make_set=yes

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

ACLOCAL='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run aclocal-1.11'
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run tar'
AR=''
AUTOCONF='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run autoconf'
AUTOHEADER='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run autoheader'
AUTOMAKE='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run automake-1.11'
AWK='awk'
CC='/usr/bin/gcc-4.2'
CCDEPMODE=''
CFLAGS=''
CPP=''
CPPFLAGS=''
CYGPATH_W='echo'
DEFS=''
DEPDIR=''
DOXYGEN=''
DOXYGEN_FALSE=''
DOXYGEN_TRUE=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C='\c'
ECHO_N=''
ECHO_T=''
EGREP=''
EXEEXT=''
FGREP=''
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD=''
LDFLAGS=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
MAKEINFO='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/missing --run makeinfo'
MKDIR_P='config/install-sh -c -d'
NM=''
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OTOOL64=''
OTOOL=''
PACKAGE='yaml'
PACKAGE_BUGREPORT='http://pyyaml.org/newticket?component=libyaml'
PACKAGE_NAME='yaml'
PACKAGE_STRING='yaml 0.1.4'
PACKAGE_TARNAME='yaml'
PACKAGE_URL=''
PACKAGE_VERSION='0.1.4'
PATH_SEPARATOR=':'
RANLIB=''
SED=''
SET_MAKE=''
SHELL='/bin/sh'
STRIP=''
VERSION='0.1.4'
YAML_LT_AGE='0'
YAML_LT_CURRENT='2'
YAML_LT_RELEASE='0'
YAML_LT_REVISION='2'
ac_ct_CC='/usr/bin/gcc-4.2'
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include=''
am__isrc=''
am__leading_dot='.'
am__quote=''
am__tar='${AMTAR} chof - "$tardir"'
am__untar='${AMTAR} xf -'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /Users/duncanstuart/.rvm/src/yaml-0.1.4/config/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
lt_ECHO='/bin/echo'
mandir='${datarootdir}/man'
mkdir_p='$(top_builddir)/config/install-sh -c -d'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/Users/duncanstuart/.rvm/usr'
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 "yaml"
#define PACKAGE_TARNAME "yaml"
#define PACKAGE_VERSION "0.1.4"
#define PACKAGE_STRING "yaml 0.1.4"
#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component=libyaml"
#define PACKAGE_URL ""
#define PACKAGE "yaml"
#define VERSION "0.1.4"
#define YAML_VERSION_MAJOR 0
#define YAML_VERSION_MINOR 1
#define YAML_VERSION_PATCH 4
#define YAML_VERSION_STRING "0.1.4"

configure: exit 77

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑红尘 2024-12-30 21:31:37

最终结果证明这相当简单 - 非常感谢评论中帮助解决这个问题的每个人。

有两个问题:

问题 1:gcc 编译器无法工作

症状:

依赖于 gcc 的函数失败,并在配置日志中显示以下内容(例如/Users//.rvm/log/ruby-1.9. 3-p0/yaml/configure.log):

checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no

...以及配置日志中的以下内容(例如/Users//.rvm/src/yaml-0.1.4/config.log):

ld: library not found for -lcrt1.10.6.o

根本问题:

Xcode 尚未正确安装。具体来说,文件 /Developer/SDKs/MacOSX10.6.sdk/usr/lib/crt1.10.6.o 不存在。

解决方案:

http://trac.macports.org/ticket/21784:“尝试重新安装 Xcode,确保选择“unix 开发支持”选项。

问题 2:RVM 无法安装 ruby​​ 1.9.3

症状:

rvm install ruby​​ 1.9.3 失败,并显示 ERROR: Error running 'make '

相应的 /Users //.rvm/log/ruby-1.9.3-p0/make.log 包含以下片段:

compiling openssl_missing.c
In file included from openssl_missing.c:22:
openssl_missing.h:173: error: conflicting types for ‘BN_rand_range’
/usr/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
openssl_missing.h:177: error: conflicting types for ‘BN_pseudo_rand_range’
/usr/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here
openssl_missing.c:270: error: conflicting types for ‘BN_rand_range’
/usr/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
openssl_missing.c:278: error: conflicting types for ‘BN_pseudo_rand_range’
/usr/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here

根本问题:

与之前的运行冲突安装的(对此并不完全确定)

解决方案

https://rvm.beginrescueend.com/packages/openssl/:清除您尝试安装的 ruby并重新安装:

rvm remove 1.9.3
rvm install 1.9.3

我还删除了另外两个红宝石 - ruby​​-1.9.2-p290 和 ruby​​-1.9.2-p136,这可能与它...:

This turned out to be fairly simple in the end - many thanks to everyone in the comments who helped work it out.

There were two issues:

Issue 1: gcc compiler wasn't working

Symptoms:

Functions dependent on gcc fail with the following in the configure log (e.g./Users/<user>/.rvm/log/ruby-1.9.3-p0/yaml/configure.log):

checking for gcc... /usr/bin/gcc-4.2
checking whether the C compiler works... no

...and the following in the config log (e.g. /Users/<user>/.rvm/src/yaml-0.1.4/config.log):

ld: library not found for -lcrt1.10.6.o

Root issue:

Xcode hasn't been installed properly. Specifically the file /Developer/SDKs/MacOSX10.6.sdk/usr/lib/crt1.10.6.o doesn't exist.

Solution:

http://trac.macports.org/ticket/21784: "Try reinstalling Xcode, make sure you choose the "unix development support" option."

Issue 2: RVM wouldn't install ruby 1.9.3

Symptoms:

rvm install ruby 1.9.3 fails with ERROR: Error running 'make '

The corresponding /Users/<user>/.rvm/log/ruby-1.9.3-p0/make.log contains the following segment:

compiling openssl_missing.c
In file included from openssl_missing.c:22:
openssl_missing.h:173: error: conflicting types for ‘BN_rand_range’
/usr/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
openssl_missing.h:177: error: conflicting types for ‘BN_pseudo_rand_range’
/usr/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here
openssl_missing.c:270: error: conflicting types for ‘BN_rand_range’
/usr/include/openssl/bn.h:411: error: previous declaration of ‘BN_rand_range’ was here
openssl_missing.c:278: error: conflicting types for ‘BN_pseudo_rand_range’
/usr/include/openssl/bn.h:412: error: previous declaration of ‘BN_pseudo_rand_range’ was here

Root issue:

Conflicts with previous runs of the install (not entirely sure about this).

Solution

https://rvm.beginrescueend.com/packages/openssl/: clean out the ruby you are trying to install and reinstall:

rvm remove 1.9.3
rvm install 1.9.3

I also removed two other rubies - ruby-1.9.2-p290 and ruby-1.9.2-p136, which might have had something to do with it...:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文