编译 Haskell“Hello World”在 Mac Snow Leopard 上 - 找不到 crt1.10.5.o
只是试图编译一些简单的 Haskell,但它找不到 c 运行时,尽管事实上它们就在那里:
$ cat hello_world.hs
main = putStrLn "hello, world"
$ ghc --make hello_world
[1 of 1] Compiling Main ( hello_world.hs, hello_world.o )
Linking hello_world ...
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status
$ file /usr/lib/crt1.10.5.o
/usr/lib/crt1.10.5.o: Mach-O universal binary with 3 architectures
/usr/lib/crt1.10.5.o (for architecture x86_64): Mach-O 64-bit object x86_64
/usr/lib/crt1.10.5.o (for architecture i386): Mach-O object i386
/usr/lib/crt1.10.5.o (for architecture ppc7400): Mach-O object ppc
$ uname -a
Darwin Nyx.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.2
我从 http://hackage.haskell.org/platform/mac.html
Verbose dump:
$ ghc -v --make hello_world
Glasgow Haskell Compiler, Version 7.0.2, for Haskell 98, stage 2 booted by GHC version 6.12.3
Using binary package database: /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/package.conf.d/package.cache
Using binary package database: /Users/Anm/.ghc/i386-darwin-7.0.2/package.conf.d/package.cache
wired-in package ghc-prim mapped to ghc-prim-0.2.0.0-6bf7b03ebc9c668817e4379b6796c0c2
wired-in package integer-gmp mapped to integer-gmp-0.2.0.3-91607778cf3ae8f3948a50062b4f8479
wired-in package base mapped to base-4.3.1.0-93953b308d1897309792406495cf356b
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.5.0.0-5134a59c0456de4c2a07cc56fa258728
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
*** Chasing dependencies:
Chasing modules from: *hello_world.hs
Stable obj: [Main]
Stable BCO: []
Ready for upsweep
[NONREC
ModSummary {
ms_hs_date = Thu Mar 31 18:11:40 PDT 2011
ms_mod = main:Main,
ms_imps = [import Prelude]
ms_srcimps = []
}]
compile: input file hello_world.hs
Created temporary directory: /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0
*** Checking old interface for main:Main:
[1 of 1] Skipping Main ( hello_world.hs, hello_world.o )
*** Deleting temp files:
Deleting: /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0/ghc13751_0.s
Warning: deleting non-existent /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0/ghc13751_0.s
Upsweep completely successful.
*** Deleting temp files:
Deleting:
link: linkables are ...
LinkableM (Thu Mar 31 18:11:51 PDT 2011) main:Main
[DotO hello_world.o]
Linking hello_world ...
*** Linker:
/Developer/usr/bin/gcc -v -o hello_world -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -fno-stack-protector -DDONT_WANT_WIN32_DLL_SUPPORT hello_world.o -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/base-4.3.1.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/integer-gmp-0.2.0.3 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/ghc-prim-0.2.0.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2 -lHSrtsmain -lHSbase-4.3.1.0 -liconv -lHSinteger-gmp-0.2.0.3 -lHSghc-prim-0.2.0.0 -lHSrts -lm -ldl -u _ghczmprim_GHCziTypes_Izh_static_info -u _ghczmprim_GHCziTypes_Czh_static_info -u _ghczmprim_GHCziTypes_Fzh_static_info -u _ghczmprim_GHCziTypes_Dzh_static_info -u _base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u _base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u _base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info -u _base_GHCziWord_W8zh_static_info -u _base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info -u _base_GHCziWord_W64zh_static_info -u _base_GHCziStable_StablePtr_static_info -u _ghczmprim_GHCziTypes_Izh_con_info -u _ghczmprim_GHCziTypes_Czh_con_info -u _ghczmprim_GHCziTypes_Fzh_con_info -u _ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u _base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info -u _ghczmprim_GHCziBool_False_closure -u _ghczmprim_GHCziBool_True_closure -u _base_GHCziPack_unpackCString_closure -u _base_GHCziIOziException_stackOverflow_closure -u _base_GHCziIOziException_heapOverflow_closure -u _base_ControlziExceptionziBase_nonTermination_closure -u _base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -u _base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -u _base_ControlziExceptionziBase_nestedAtomically_closure -u _base_GHCziWeak_runFinalizzerBatch_closure -u _base_GHCziTopHandler_runIO_closure -u _base_GHCziTopHandler_runNonIO_closure -u _base_GHCziConcziIO_ensureIOManagerIsRunning_closure -u _base_GHCziConcziSync_runSparks_closure -u _base_GHCziConcziSignal_runHandlers_closure -Wl,-search_paths_first -read_only_relocs warning -lHSffi
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~123/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)
/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/collect2 -dynamic -arch i386 -macosx_version_min 10.5 -read_only_relocs warning -syslibroot /Developer/SDKs/MacOSX10.5.sdk -weak_reference_mismatches non-weak -u _ghczmprim_GHCziTypes_Izh_static_info -u _ghczmprim_GHCziTypes_Czh_static_info -u _ghczmprim_GHCziTypes_Fzh_static_info -u _ghczmprim_GHCziTypes_Dzh_static_info -u _base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u _base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u _base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info -u _base_GHCziWord_W8zh_static_info -u _base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info -u _base_GHCziWord_W64zh_static_info -u _base_GHCziStable_StablePtr_static_info -u _ghczmprim_GHCziTypes_Izh_con_info -u _ghczmprim_GHCziTypes_Czh_con_info -u _ghczmprim_GHCziTypes_Fzh_con_info -u _ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u _base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info -u _ghczmprim_GHCziBool_False_closure -u _ghczmprim_GHCziBool_True_closure -u _base_GHCziPack_unpackCString_closure -u _base_GHCziIOziException_stackOverflow_closure -u _base_GHCziIOziException_heapOverflow_closure -u _base_ControlziExceptionziBase_nonTermination_closure -u _base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -u _base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -u _base_ControlziExceptionziBase_nestedAtomically_closure -u _base_GHCziWeak_runFinalizzerBatch_closure -u _base_GHCziTopHandler_runIO_closure -u _base_GHCziTopHandler_runNonIO_closure -u _base_GHCziConcziIO_ensureIOManagerIsRunning_closure -u _base_GHCziConcziSync_runSparks_closure -u _base_GHCziConcziSignal_runHandlers_closure -o hello_world -lcrt1.10.5.o -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/base-4.3.1.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/integer-gmp-0.2.0.3 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/ghc-prim-0.2.0.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2 -L/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1 -L/Developer/usr/bin/../lib/gcc -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -L/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1/../../.. hello_world.o -lHSrtsmain -lHSbase-4.3.1.0 -liconv -lHSinteger-gmp-0.2.0.3 -lHSghc-prim-0.2.0.0 -lHSrts -lm -ldl -search_paths_first -lHSffi -lgcc_s.10.5 -lgcc -lSystem
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting: /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0
Okay...
/usr/lib/gcc/i686-apple-darwin10/4.2.1/
is on the implicit library path, but...$ ls /usr/lib/gcc/i686-apple-darwin10/4.2.1/
crt3.o include libcc_kext.a libgcc_eh.a libgcov.a libgomp.spec x86_64
finclude install-tools libgcc.a libgcc_static.a libgomp.a libstdc++.dylib
Just trying to compile some trivial Haskell, but its not finding the c runtimes, despite the fact that they're right there:
$ cat hello_world.hs
main = putStrLn "hello, world"
$ ghc --make hello_world
[1 of 1] Compiling Main ( hello_world.hs, hello_world.o )
Linking hello_world ...
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status
$ file /usr/lib/crt1.10.5.o
/usr/lib/crt1.10.5.o: Mach-O universal binary with 3 architectures
/usr/lib/crt1.10.5.o (for architecture x86_64): Mach-O 64-bit object x86_64
/usr/lib/crt1.10.5.o (for architecture i386): Mach-O object i386
/usr/lib/crt1.10.5.o (for architecture ppc7400): Mach-O object ppc
$ uname -a
Darwin Nyx.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.0.2
I installed from http://hackage.haskell.org/platform/mac.html
Verbose dump:
$ ghc -v --make hello_world
Glasgow Haskell Compiler, Version 7.0.2, for Haskell 98, stage 2 booted by GHC version 6.12.3
Using binary package database: /Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/package.conf.d/package.cache
Using binary package database: /Users/Anm/.ghc/i386-darwin-7.0.2/package.conf.d/package.cache
wired-in package ghc-prim mapped to ghc-prim-0.2.0.0-6bf7b03ebc9c668817e4379b6796c0c2
wired-in package integer-gmp mapped to integer-gmp-0.2.0.3-91607778cf3ae8f3948a50062b4f8479
wired-in package base mapped to base-4.3.1.0-93953b308d1897309792406495cf356b
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.5.0.0-5134a59c0456de4c2a07cc56fa258728
wired-in package dph-seq not found.
wired-in package dph-par not found.
Hsc static flags: -static
*** Chasing dependencies:
Chasing modules from: *hello_world.hs
Stable obj: [Main]
Stable BCO: []
Ready for upsweep
[NONREC
ModSummary {
ms_hs_date = Thu Mar 31 18:11:40 PDT 2011
ms_mod = main:Main,
ms_imps = [import Prelude]
ms_srcimps = []
}]
compile: input file hello_world.hs
Created temporary directory: /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0
*** Checking old interface for main:Main:
[1 of 1] Skipping Main ( hello_world.hs, hello_world.o )
*** Deleting temp files:
Deleting: /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0/ghc13751_0.s
Warning: deleting non-existent /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0/ghc13751_0.s
Upsweep completely successful.
*** Deleting temp files:
Deleting:
link: linkables are ...
LinkableM (Thu Mar 31 18:11:51 PDT 2011) main:Main
[DotO hello_world.o]
Linking hello_world ...
*** Linker:
/Developer/usr/bin/gcc -v -o hello_world -march=i686 -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -fno-stack-protector -DDONT_WANT_WIN32_DLL_SUPPORT hello_world.o -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/base-4.3.1.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/integer-gmp-0.2.0.3 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/ghc-prim-0.2.0.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2 -lHSrtsmain -lHSbase-4.3.1.0 -liconv -lHSinteger-gmp-0.2.0.3 -lHSghc-prim-0.2.0.0 -lHSrts -lm -ldl -u _ghczmprim_GHCziTypes_Izh_static_info -u _ghczmprim_GHCziTypes_Czh_static_info -u _ghczmprim_GHCziTypes_Fzh_static_info -u _ghczmprim_GHCziTypes_Dzh_static_info -u _base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u _base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u _base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info -u _base_GHCziWord_W8zh_static_info -u _base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info -u _base_GHCziWord_W64zh_static_info -u _base_GHCziStable_StablePtr_static_info -u _ghczmprim_GHCziTypes_Izh_con_info -u _ghczmprim_GHCziTypes_Czh_con_info -u _ghczmprim_GHCziTypes_Fzh_con_info -u _ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u _base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info -u _ghczmprim_GHCziBool_False_closure -u _ghczmprim_GHCziBool_True_closure -u _base_GHCziPack_unpackCString_closure -u _base_GHCziIOziException_stackOverflow_closure -u _base_GHCziIOziException_heapOverflow_closure -u _base_ControlziExceptionziBase_nonTermination_closure -u _base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -u _base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -u _base_ControlziExceptionziBase_nestedAtomically_closure -u _base_GHCziWeak_runFinalizzerBatch_closure -u _base_GHCziTopHandler_runIO_closure -u _base_GHCziTopHandler_runNonIO_closure -u _base_GHCziConcziIO_ensureIOManagerIsRunning_closure -u _base_GHCziConcziSync_runSparks_closure -u _base_GHCziConcziSignal_runHandlers_closure -Wl,-search_paths_first -read_only_relocs warning -lHSffi
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~123/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)
/Developer/usr/bin/../libexec/gcc/i686-apple-darwin10/4.2.1/collect2 -dynamic -arch i386 -macosx_version_min 10.5 -read_only_relocs warning -syslibroot /Developer/SDKs/MacOSX10.5.sdk -weak_reference_mismatches non-weak -u _ghczmprim_GHCziTypes_Izh_static_info -u _ghczmprim_GHCziTypes_Czh_static_info -u _ghczmprim_GHCziTypes_Fzh_static_info -u _ghczmprim_GHCziTypes_Dzh_static_info -u _base_GHCziPtr_Ptr_static_info -u _base_GHCziWord_Wzh_static_info -u _base_GHCziInt_I8zh_static_info -u _base_GHCziInt_I16zh_static_info -u _base_GHCziInt_I32zh_static_info -u _base_GHCziInt_I64zh_static_info -u _base_GHCziWord_W8zh_static_info -u _base_GHCziWord_W16zh_static_info -u _base_GHCziWord_W32zh_static_info -u _base_GHCziWord_W64zh_static_info -u _base_GHCziStable_StablePtr_static_info -u _ghczmprim_GHCziTypes_Izh_con_info -u _ghczmprim_GHCziTypes_Czh_con_info -u _ghczmprim_GHCziTypes_Fzh_con_info -u _ghczmprim_GHCziTypes_Dzh_con_info -u _base_GHCziPtr_Ptr_con_info -u _base_GHCziPtr_FunPtr_con_info -u _base_GHCziStable_StablePtr_con_info -u _ghczmprim_GHCziBool_False_closure -u _ghczmprim_GHCziBool_True_closure -u _base_GHCziPack_unpackCString_closure -u _base_GHCziIOziException_stackOverflow_closure -u _base_GHCziIOziException_heapOverflow_closure -u _base_ControlziExceptionziBase_nonTermination_closure -u _base_GHCziIOziException_blockedIndefinitelyOnMVar_closure -u _base_GHCziIOziException_blockedIndefinitelyOnSTM_closure -u _base_ControlziExceptionziBase_nestedAtomically_closure -u _base_GHCziWeak_runFinalizzerBatch_closure -u _base_GHCziTopHandler_runIO_closure -u _base_GHCziTopHandler_runNonIO_closure -u _base_GHCziConcziIO_ensureIOManagerIsRunning_closure -u _base_GHCziConcziSync_runSparks_closure -u _base_GHCziConcziSignal_runHandlers_closure -o hello_world -lcrt1.10.5.o -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/base-4.3.1.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/integer-gmp-0.2.0.3 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2/ghc-prim-0.2.0.0 -L/Library/Frameworks/GHC.framework/Versions/7.0.2-i386/usr/lib/ghc-7.0.2 -L/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1 -L/Developer/usr/bin/../lib/gcc -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/usr/lib/gcc/i686-apple-darwin10/4.2.1 -L/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1/../../../i686-apple-darwin10/4.2.1 -L/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1/../../.. hello_world.o -lHSrtsmain -lHSbase-4.3.1.0 -liconv -lHSinteger-gmp-0.2.0.3 -lHSghc-prim-0.2.0.0 -lHSrts -lm -ldl -search_paths_first -lHSffi -lgcc_s.10.5 -lgcc -lSystem
ld: library not found for -lcrt1.10.5.o
collect2: ld returned 1 exit status
*** Deleting temp files:
Deleting:
*** Deleting temp dirs:
Deleting: /var/folders/UE/UEH-SvA7E-GPjyBwX5XrfU+++TI/-Tmp-/ghc13751_0
Okay...
/usr/lib/gcc/i686-apple-darwin10/4.2.1/
is on the implicit library path, but...$ ls /usr/lib/gcc/i686-apple-darwin10/4.2.1/
crt3.o include libcc_kext.a libgcc_eh.a libgcov.a libgomp.spec x86_64
finclude install-tools libgcc.a libgcc_static.a libgomp.a libstdc++.dylib
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我有同样的问题。这是我的解决方案:
sudo ln -s /Developer/SDKs/MacOSX10.6.sdk /Developer/SDKs/MacOSX10.5.sdk
它确实有效!
I have the same problem. Here is my solution:
sudo ln -s /Developer/SDKs/MacOSX10.6.sdk /Developer/SDKs/MacOSX10.5.sdk
It just works!
尝试使用 -L 选项显式告诉 GHC 搜索 /usr/lib 目录:
Try using the
-L
option to explicitly tell GHC to search the/usr/lib
directory:GHC 7.0.3 修复了 Mac 上的问题,获取该版本的最简单方法(无需等待下一个 Haskell 平台版本)是安装 Homebrew 版本的 Haskell 软件包。
我不再需要这里描述的任何技巧。
GHC 7.0.3 fixes the issues on Mac, and the easiest way to get that version (short of waiting for the next Haskell Platform release) is to install the Homebrew version of Haskell Package.
I no longer need any of the hacks described here.
几周前在 hakyll 中获取 regex-pcre 支持时遇到了类似的问题。 ghc -L/usr/lib 在 Snow Leopard 上对我来说失败了( ghc 仍然链接到 /Developer/SDKs/MacOSX10.5.sdk/usr )。我真不知道这是一个bug还是我没有完全理解ghc的奥秘。
无论如何,我解决这个问题的方法是将 /usr 符号链接到 /Developer/SDKs/MacOSX10.5.sdk/usr。这是一件丑陋、可怕的事情,但经过几个小时的 ghc 战斗和导出库路径环境变量后,我选择了“有效”而不是“正确”。
Had a similar problem a couple weeks ago when getting regex-pcre support built in hakyll. ghc -L/usr/lib failed on Snow Leopard for me (ghc still linked against /Developer/SDKs/MacOSX10.5.sdk/usr ). I really don't know if this is a bug or a failure to fully comprehend the mysteries of ghc on my part.
Regardless, the way I solved it was to just symlink /usr to /Developer/SDKs/MacOSX10.5.sdk/usr. Ugly, terrible thing to do, but after hours of fighting ghc and exporting library path environment variables, I settled for "works" over "right".