GHC錯誤我試圖編譯和使用GHC鏈接簡單的程序,但在連接過程中失敗了:與系統上的OS X Lion的
import System (getArgs)
main = do
args <- getArgs
print args
我試着用
% ghc -c -O Main.hs
% ghc -o Main Main.o
ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog
Undefined symbols for architecture i386:
"___stginit_haskell98zm1zi1zi0zi1_System_", referenced from:
___stginit_Main_ in Main.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
zsh: exit 1 ghc -o Main Main.o
編譯然而,當用--make編譯:
% ghc --make Main.hs
一切正常(除噸LD警告)
點有關環境的一些更多的信息:
% ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.3
從哈斯克爾平臺的Mac OS X 10.6(英特爾32位GHC)
系統:最大OS X獅子10.7.2
任何想法怎麼了?
(順便說一句,我試圖安裝HP 64位,但在安裝過程中失敗)