gcc不工作 - Xcode 3.2.6 - Snow Leopard [英] gcc not working - Xcode 3.2.6 - Snow Leopard
问题描述
主要症状是当试图运行 rvm install 1.9.3
我得到以下跟踪:
将Ruby从源代码安装到:/Users/duncanstuart/.rvm/rubies/ruby -1.9.3-p0,这可能需要一段时间取决于你的cpu(s)...
ruby-1.9.3-p0 - #fetching
ruby-1.9.3- p0 - #提取到/Users/duncanstuart/.rvm/src/ruby-1.9.3-p0(已提取)
将yaml-0.1.4.tar.gz提取到/Users/duncanstuart/.rvm/archives
将yaml-0.1.4.tar.gz解压缩到/Users/duncanstuart/.rvm/src
在/Users/duncanstuart/.rvm/src/yaml-0.1.4中配置yaml。
错误:运行'./configure --prefix =/ Users / duncanstuart / .rvm / usr错误,请阅读/Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml /configure.log
在/Users/duncanstuart/.rvm/src/yaml-0.1.4中编译yaml。
错误:运行'make'时出错,请阅读/Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/make.log
将yaml安装到/ Users / duncanstuart /。 rvm / usr
错误:运行'make install'时出错,请阅读/Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/yaml/make.install.log
ruby-1.9 .3-p0 - #configuring
错误:运行'./configure --prefix = / Users / duncanstuart / .rvm / rubies / ruby-1.9.3-p0 --enable-shared --disable-install时出错-doc --with-libyaml-dir = / Users / duncanstuart / .rvm / usr',请阅读/Users/duncanstuart/.rvm/log/ruby-1.9.3-p0/configure.log
错误:运行configure时出错。停止安装。
yaml / configure.log
如下所示:
[2012-01-04 02:06:11] ./configure --prefix =/ Users /duncanstuart/.rvm/usr
检查BSD兼容安装... / usr / bin / install -c
检查构建环境是否理智...是
检查一个线程安全的mkdir -p ... config / install-sh -c -d
检查gawk ...没有
检查mawk ...没有
检查nawk .. 。no
检查awk ... awk
检查make sets $(MAKE)... yes
检查gcc ... /usr/bin/gcc-4.2
检查C编译器是否工作... no
configure:error:在`/Users/duncanstuart/.rvm/src/yaml-0.1.4'中:
configure:error:C编译器无法创建可执行文件
查看`config.log'获取更多详细信息
我猜想关键线是:
检查gcc ... /usr/bin/gcc-4.2
检查C编译器是否工作正常。no
$ yaml / make.log
和的内容c $ c>
yaml / make.install.log 是一样的(当然除了前两行)
config.log
文件包含在这个问题的最后(因为它很长!)。重要的行似乎是:
`ld:library找不到-lcrt1.10.6.o`
运行 rvm install ...
时遇到同样的错误任何其他版本的红宝石,或者当试图用Homebrew安装某些东西时 brew install wget
我的理论
我怀疑这与错误地卸载和重新安装Xcode 3.2.6有关 - 请参阅下面的历史记录,了解我所做的全部细节。
我已经看过在一堆stackoverflow职位,但没有人似乎回答: 以下行在 如果您的建议是升级到狮子并安装最新的Xcode那么就这样吧。 以下是我的步骤其次:我不知道什么是相关的,所以我会列出所有。 尝试运行 谷歌搜索表明,这是一种冲突,因此机器上有两个openssl的定义我记得有一个来自Homebrew的关于 这行不通,我完全理解我在做什么,我用 最后,我下载了安装的Xcode 3.2.6 (Snow Leopard最新的Xcode?)并且已经用完了。 这是config.log文件的内容 - 位于 最后,结果非常简单 - 非常感谢评论中的每个人帮助解决问题。 有两个问题: 依赖于gcc的函数在配置日志中失败,例如 ...以及配置日志(例如 Xcode尚未正确安装。特别是文件 http://trac.macports .org / ticket / 21784 :尝试重新安装Xcode,确保选择了unix development support选项。问题2:RVM wouldn' t install ruby 1.9.3 相应的
yaml / configure.log
My Setup
/ 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 2010年10月24日/ usr / bin / gcc- 4.2
历史记录
rvm install 1.9.3
我得到了一个我认为与此类似的错误:
openssl_missing.h:173:error:冲突类型'BN_rand_range'
/usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:411:error:以前的'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:e rror:'BN_pseudo_rand_range'的冲突类型
/usr/local/Cellar/openssl/0.9.8r/include/openssl/bn.h:412:错误:之前的'BN_pseudo_rand_range'声明在这里
与MacPorts冲突的警告,我试图卸载MacPorts / strong>在Macports
Wiki上使用指令
。
我也从我的
.bash_profile中删除了一些与MacPorts相关的行。
sudo< Xcode> / Library / uninstall-devtools --mode = all
来卸载Xcode 。 这当然会让事情变得更糟,导致上面显示的错误。因此,我从原始CD中重新安装了Xcode - 结果是 Xcode 3.0 。
config.log
/Users/duncanstuart/.rvm/src/yaml-0.1.4 /
这个文件包含编译器产生的任何消息,而
正在运行configure,在配置出错时帮助调试。
它由yaml configure 0.1.4创建,它是由GNU Autoconf 2.67生成的
。调用命令行是
$ ./configure --prefix = / Users / duncanstuart / .rvm / usr CC = / usr / bin / gcc-4.2 --no-create --no-recursion
## --------- ##
##平台。 ##
## --------- ##
主机名= duncan-stuarts-macbook.local
uname -m = i386
uname -r = 10.8.0
uname -s =达尔文
uname -v =达尔文内核版本10.8.0:星期二6月16日16:33:36 PDT 2011; root:xnu-1504.15.3〜1 / RELEASE_I386
/ usr / bin / uname -p = i386
/ bin / uname -X =未知
/ bin / arch =未知
/ usr / bin / arch -k =未知
/ usr / convex / getsysinfo =未知
/ usr / bin / hostinfo = Mach内核版本:
达尔文内核版本10.8.0:星期二6月6日16:33:36 PDT 2011; root:xnu-1504.15.3〜1 / RELEASE_I386
配置最多2个处理器的内核。
2处理器在物理上可用。
2处理器在逻辑上可用。
处理器类型:i486(Intel 80486)
处理器活动:0 1
主内存可用:3.00千兆字节
默认处理器集:95个任务,425个线程,2个处理器
平均载荷:0.87,马赫系数:1.12
/ bin /机器=未知
/ usr / bin / oslevel =未知
/ bin / universe =未知
路径:/Users/duncanstuart/.rvm/usr/bin
路径:/ usr / local / bin
路径:/ usr / local / sbin
路径:/ 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
## -------- --- ##
##核心测试。 ##
## ----------- ##
configure:2409:检查BSD兼容安装
configure:2477:result: / usr / bin / install -c
configure:2488:检查生成环境是否合理
configure:2538:result:yes
configure:2679:检查线程安全的mkdir -p
configure:2718:result:config / install-sh -c -d
configure:2731:检查gawk
configure:2761:result:no
configure:2731:检查for mawk
configure:2761:result:no
configure:2731:检查nawk
configure:2761:result:no
configure:2731:检查awk
configure:2747:found / usr / bin / awk
configure:2758:result:awk
configure:2769:检查make sets $(MAKE)
configure:2791:result:yes
configure:2947:检查gcc
configure:2974:result:/usr/bin/gcc-4.2
configure:3203:检查C编译器版本
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.
这是免费软件;请参阅复制条件的来源。没有任何b $ b保修;甚至不适用于适销性或针对特定用途的适用性。
configure:3223:$? = 0
configure:3212:/usr/bin/gcc-4.2 -v>& 5
使用内置规格。
目标:i686-apple-darwin10
配置为:/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
线程模型:posix
gcc版本4.2.1(Apple Inc. build 5666)(dot 3)
配置:3223:$? = 0
configure:3212:/usr/bin/gcc-4.2 -V>& 5
gcc-4.2:缺少`-V'参数
configure:3223:$ ? = 1
configure:3212:/usr/bin/gcc-4.2 -qversion> 5
i686-apple-darwin10-gcc-4.2.1:没有输入文件
configure: 3223:$? = 1
configure:3243:检查C编译器是否工作
configure:3265:/usr/bin/gcc-4.2 conftest.c>& 5
ld:找不到-lcrt1.10.6.o
collect2:ld返回1退出状态
configure:3269:$? = 1
configure:3307:result:no
configure:失败的程序是:
| / * confdefs.h * /
| #define PACKAGE_NAMEyaml
| #define PACKAGE_TARNAMEyaml
| #define PACKAGE_VERSION0.1.4
| #define PACKAGE_STRINGyaml 0.1.4
| #define PACKAGE_BUGREPORThttp://pyyaml.org/newticket?component=libyaml
| #define PACKAGE_URL
| #define PACKAGEyaml
| #define VERSION0.1.4
| #define YAML_VERSION_MAJOR 0
| #define YAML_VERSION_MINOR 1
| #define YAML_VERSION_PATCH 4
| #define YAML_VERSION_STRING0.1.4
| / *结束confdefs.h。 * /
|
| int
| main()
| {
|
| ;
|返回0;
| }
configure:3312:error:in`/Users/duncanstuart/.rvm/src/yaml-0.1.4':
configure:3314:错误:C编译器无法创建可执行文件
请参阅`config.log'获取更多细节
## ---------------- ##
##高速缓存变量。 ##
## ---------------- ##
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
# #----------------- ##
##输出变量。 ##
## ----------------- ##
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 =''
EGR EP =''
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'
uild =''
build_alias =''
build_cpu =''
build_os =''
build_vendor =''
datadir ='$ {datarootdir}'
datarootdir ='$ {前缀} / 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_NAMEyaml
#define PACKAGE_TARNAMEyaml
#define PACKAGE_VERSION0.1.4
#define PACKAGE_STRINGyaml 0.1.4
#define PACKAGE_BUGREPORThttp://pyyaml.org/newticket?component = libyaml
#define PACKAGE_URL
#define PACKAGEyaml
#define VERSION0.1.4
#define YAML_VERSION_MAJOR 0
#define YAML_VERSION_MINOR 1
#define YAML_VERSION_PATCH 4
#define YAML_VERSION_STRING0.1.4
configure:exit 77
问题1:gcc编译器无法正常工作
症状:
/ Users /< user> /。 RVM /日志/红宝石1.9.3-P0 / YAML / CO nfigure.log
):
检查gcc ... /usr/bin/gcc-4.2
检查C编译器是否工作... no
pre> ld:library找不到-lcrt1.10.6.o
< h2>根问题:
/Developer/SDKs/MacOSX10.6.sdk/usr/lib/crt1.10.6.o
不存在。
解决方案:
$ b $ h2症状:
$ b rvm install ruby 1.9.3
错误:运行'make'错误
c> / Users /< user> /。rvm / log / ruby-1.9.3-p0 / make.log
包含以下内容:
编译openssl_missing.c
从openssl_missing.c包含的文件中:22:
openssl_missing.h:173:错误:'BN_rand_range'$ b的冲突类型$ b /usr/include/openssl/bn.h:411:错误:之前的'BN_rand_range'声明在这里
openssl_missing.h:177:error:冲突类型for BN_pseudo_rand_range'
/usr/include/openssl/bn.h:412:错误:之前的'BN_pseudo_rand_range'声明在这里
openssl_missing.c:270:错误:'BN_rand_range'$ b $的冲突类型b /usr/include/openssl/bn.h:411:错误:之前的'BN_rand_range'声明在这里
openssl_missing.c:278:错误:'BN_pseudo_rand_range'的冲突类型
/ usr / include /openssl/bn.h:412:error:以前的'BN_pseudo_rand_range'声明在这里
根问题:
$ b 与以前的安装运行冲突(不完全确定)。
解决方案
https://rvm.beginrescueend.com/ packages / openssl / :清理你试图安装并重新安装的ruby:
rvm remove 1.9.3
rvm install 1.9.3
我还删除了另外两个红宝石 - r uby-1.9.2-p290和ruby-1.9.2-p136,这可能与它有关...:
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:
- Can't install Ruby under Lion with RVM – GCC issues is closest to my problem, but ultimately seems to be related to Xcode 4
- In Error installing Ruby with RVM the author doesn't actually have a c compiler. Problems installing Ruby with RVM: rvm install 1.8.7, rvm install 1.9.2 is probalbly the same.
- Make error installing Ruby 1.9.2 via rvm OSX Lion 10.7.2 XCode 4.2 is similar but has different errors in
yaml/configure.log
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.
- 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
- I had macports installed - I can't remember why.
- I had more recently installed Homebrew for some reason or other
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
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).
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
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
.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.
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
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
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...:
这篇关于gcc不工作 - Xcode 3.2.6 - Snow Leopard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!