2012-02-06 68 views
0

我试图在Mac OS 10.7上安装PROJ.4 - 地图预测库(http://trac.osgeo.org/proj/wiki/WikiStart#Download)。 2。我下载了.tar.gz文件并继续运行./configure。当试图在MacOS上构建PROJ.4库(&rgdal)时,“C编译器无法创建可执行文件”10.7.2

进程退出与以下错误:

checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... ./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 whether to enable maintainer-specific portions of Makefiles... no 
checking for gcc... gcc 
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables 
See `config.log' for more details. 

该文件的config.log包含以下信息:

/bin/arch    = unknown 
/usr/bin/arch -k  = unknown 
/usr/convex/getsysinfo = unknown 
/usr/bin/hostinfo  = Mach kernel version: 
    Darwin Kernel Version 11.2.0: Tue Aug 9 20:54:00 PDT 2011; root:xnu-1699.24.8~1/RELEASE_X86_64 
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: 2.00 gigabytes 
Default processor set: 129 tasks, 746 threads, 2 processors 
Load average: 5.68, Mach factor: 0.30 
/bin/machine   = unknown 
/usr/bin/oslevel  = unknown 
/bin/universe   = unknown 

PATH: /Library/Frameworks/R.framework/Resources 
PATH: /usr/local/texlive/2011/bin/universal-darwin 
PATH: /Developer/usr/bin 
PATH: /Library/Frameworks/GDAL.framework/Programs 
PATH: /Library/Frameworks/Python.framework/Versions/2.7/bin 
PATH: /usr/bin 
PATH: /bin 
PATH: /usr/sbin 
PATH: /sbin 
PATH: /usr/local/bin 
PATH: /usr/X11/bin 
PATH: /usr/texbin 


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

configure:1995: checking for a BSD-compatible install 
configure:2051: result: /usr/bin/install -c 
configure:2062: checking whether build environment is sane 
configure:2105: result: yes 
configure:2133: checking for a thread-safe mkdir -p 
configure:2172: result: ./install-sh -c -d 
configure:2185: checking for gawk 
configure:2215: result: no 
configure:2185: checking for mawk 
configure:2215: result: no 
configure:2185: checking for nawk 
configure:2215: result: no 
configure:2185: checking for awk 
configure:2201: found /usr/bin/awk 
configure:2212: result: awk 
configure:2223: checking whether make sets $(MAKE) 
configure:2244: result: yes 
configure:2432: checking whether to enable maintainer-specific portions of Makefiles 
configure:2441: result: no 
configure:2505: checking for gcc 
configure:2521: found /Developer/usr/bin/gcc 
configure:2532: result: gcc 
configure:2770: checking for C compiler version 
configure:2777: gcc --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:2780: $? = 0 
configure:2787: gcc -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:2790: $? = 0 
configure:2797: gcc -V >&5 
gcc-4.2: argument to `-V' is missing 
configure:2800: $? = 1 
configure:2823: checking for C compiler default output file name 
configure:2850: gcc conftest.c >&5 
ld: library not found for -lcrt1.10.6.o 
collect2: ld returned 1 exit status 
configure:2853: $? = 1 
configure:2891: result: 
configure: failed program was: 
| /* confdefs.h. */ 
| #define PACKAGE_NAME "PROJ.4 Projections" 
| #define PACKAGE_TARNAME "proj" 
| #define PACKAGE_VERSION "4.7.0" 
| #define PACKAGE_STRING "PROJ.4 Projections 4.7.0" 
| #define PACKAGE_BUGREPORT "[email protected]" 
| #define PACKAGE "proj" 
| #define VERSION "4.7.0" 
| /* end confdefs.h. */ 
| 
| int 
| main() 
| { 
| 
| ; 
| return 0; 
| } 
configure:2898: error: C compiler cannot create executables 
See `config.log' for more details. 

由于错误消息之一是“LD:库未找到-lcrt1.10.6.o“,我试图实现这里显示的解决方案Error in xcode project: ld: library not found for -lcrt1.10.6.o,具体是通过将以下内容添加到〜/ .bash_profile中:

export C_INCLUDE_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/include 
export LIBRARY_PATH=/Developer/SDKs/MacOSX10.5.sdk/usr/lib 

这没有奏效,我仍然遇到同样的问题。此外,错误“错误:C编译器无法创建可执行文件”似乎在我尝试的许多事情中都是持久的。当我尝试使用命令行在R中安装rgdal库时,我遇到了同样的问题。

我将不胜感激任何和所有的帮助!

非常感谢!

回答

1

您正在运行Lion,但您的gcc配置为darwin10,即Snow Leoaprd。

您是否从Snow Leopard升级到Lion而不重新安装Xcode?我建议彻底卸载旧的Xcode(运行sudo /Developer/Library/uninstall-devtools),然后从Mac App Store安装最新的Xcode。

+0

这非常好知道,非常感谢。我只是这样做,它现在似乎工作正常!谢谢! – kashin 2012-02-06 23:40:48

0

这在您的环境中通常是一个问题。您是否以任何方式更改了$ PATH或.MacOSX/environment.plist?通常,人们在遵循给定MacPorts或fink的建议时会这样做。您可以尝试撤消这些更改。

如果这不是问题,则升级操作系统通常会导致类似的症状。确保在主要操作系统升级后安装开发人员工具。

+0

感谢您的回复。我不认为是这样,因为即使我编辑了〜/ .bash_profile,清除它可以防止终端找到gcc(它位于这里:PATH =/Developer/usr/bin)。 我对〜/ .bash_profile所做的更改也是必要的,以指向我安装的正确框架,特别是Python,GDAL,LaTeX和R. – kashin 2012-02-06 16:42:58

+0

这可能是升级到Lion的问题吗?我读过一些可以搞砸的地方? – kashin 2012-02-06 16:45:41

+0

是的。升级到Lion后是否重新安装了开发人员工具? – geoffb 2012-02-06 17:48:32

相关问题