2012-02-06 69 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

相關問題