2011-04-12 51 views
2

我試圖使用安裝哈斯克爾regex-pcre庫:問題在Mac OS上安裝哈斯克爾圖書館的regex,PCRE X

cabal install --extra-include-dirs=/usr/local/include \ 
       --extra-include-dirs=/usr/include regex-pcre 

但是我得到這個奇怪的錯誤:

Resolving dependencies... 
Configuring regex-pcre-0.94.2... 
Preprocessing library regex-pcre-0.94.2... 
In file included from /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include/HsFFI.h:68, 
       from /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/template-hsc.h:4, 
       from dist/build/Text/Regex/PCRE/Wrap_hsc_make.c:1: 
/usr/include/float.h:8:24: error: float.h: No such file or directory 
In file included from /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/template-hsc.h:9, 
       from dist/build/Text/Regex/PCRE/Wrap_hsc_make.c:1: 
/usr/include/stdarg.h:4:25: error: stdarg.h: No such file or directory 
compiling dist/build/Text/Regex/PCRE/Wrap_hsc_make.c failed (exit code 1) 
command was: /usr/bin/gcc -c dist/build/Text/Regex/PCRE/Wrap_hsc_make.c -o dist/build/Text/Regex/PCRE/Wrap_hsc_make.o -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -fno-stack-protector -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -fno-stack-protector -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -D__GLASGOW_HASKELL__=700 -Ddarwin_BUILD_OS -Ddarwin_HOST_OS -Di386_BUILD_ARCH -Di386_HOST_ARCH -I/usr/include -I/usr/local/include -DHAVE_PCRE_H -DSPLIT_BASE=1 -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/bytestring-0.9.1.10/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/base-4.3.1.0/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include -I/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/include/ 
cabal: Error: some packages failed to install: 
regex-pcre-0.94.2 failed during the building phase. The exception was: 
ExitFailure 1 

的要點這,似乎是無法找到第二個float.h文件:

/usr/include/float.h:8:24: error: float.h: No such file or directory 

我已經Ø pened /usr/include/float.h和8號線讀取:

#include_next <float.h> 

我已經做了我在谷歌搜索,雖然我不知道多少CI想我明白那是什麼線應該說但是......我不知道如何真正解決這個問題。我不知道我的系統上還有一個float.h文件。

我正在使用的GHC和GCC版本。 GCC來自XCode 4.GHC是32位,但我也嘗試過64位版本,結果相同。

$ gcc --version 
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) 

$ ghc --version 
The Glorious Glasgow Haskell Compilation System, version 7.0.2 

OS X版本是10.6.7。

任何幫助非常感謝。

回答

2

對我來說很喜歡ticket #5011 - Mac上的XCode 4 + GHC 7.0.2無法鏈接。

這在GHC 7.0.3中已經修復,它將成爲Haskell平臺4月中旬發佈的一部分。

另一個解決方法是降級到2010.2 Haskell平臺。

看到這個問題昨天:Can't install OpenGLRaw-1.1.0.1 on OS X

+0

降級至2010.2哈斯克爾平臺確實解決了這個問題。我將使用它,直到下一個版本的平臺。謝謝! – 2011-04-12 17:19:03