Haskell wiki에서 얻은 간단한 예제를 실행하려고합니다. 내가 갖는GHC 패키지가 숨겨져 있습니다.
import GHC
import GHC.Paths (libdir)
import DynFlags
main =
defaultErrorHandler defaultFatalMessager defaultFlushOut $ do
runGhc (Just libdir) $ do
dflags <- getSessionDynFlags
setSessionDynFlags dflags
target <- guessTarget "test_main.hs" Nothing
setTargets [target]
load LoadAllTargets
오류 메시지는 다음과 같습니다
[email protected]$ ghc --make amy15.hs
amy15.hs:1:8:
Could not find module ‘GHC’
It is a member of the hidden package ‘ghc-7.8.3’.
Use -v to see a list of the files searched for.
amy15.hs:3:8:
Could not find module ‘DynFlags’
It is a member of the hidden package ‘ghc-7.8.3’.
Use -v to see a list of the files searched for.
지금, ghc-7.8.3
내가, 컴파일을 할 사용하고 그래서 분명히 패키지가 설치되어있는 것입니다.
[email protected]$ cabal info ghc
* ghc (library)
Versions available: [ Not available from server ]
Versions installed: 7.8.3
... and so on
왜 GHC는 ghc
패키지를 볼 수없는 이유는 무엇입니까?
숨겨진 이유는 무엇입니까? – Chinaxing