그래서이 문제를 해결하는 방법을 검색하고 검색 했으므로 방법을 찾지 못했습니다.System.Random과 같은 하스켈 라이브러리 가져 오기
우선 Haskell 프로그램에 System.Random을 가져 오려고합니다.
Could not find module `System.Random'
Use -v to see a list of the files searched for.
을 그러니 확실히 내가 그 말씀을 ... 같은 문제를 제외하고는 : 나는 ghci에서 프로그램을 실행하면
import System.Random
는 불행하게도이 그것을 반환 것입니다 ... 그게 쉬운 일이 아닙니다
Using binary package database: /usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/package.conf.d/package.cache
내가 그 디렉토리 깜짝 놀랄 ... 내 임의의 패키지로 이동이되지 않습니다 : 나는 그것을 사용하여 어떤 패키지 데이터베이스를 참조하십시오. 내 .cabal/packages로 이동하여 무작위 1.0.1.1 파일을
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/
디렉토리에 복사합니다. 프로그램을 다시 실행해도 여전히 동일한 오류가 발생합니다. ghc-7.6.3/package.conf.d를 보면 lib 내의 임의 파일을 가리키는 파일이 없다는 것을 알 수 있습니다.
무엇을해야합니까 ??
나는 필사적입니다. 패키지를 어떻게 설치합니까?
또한 내가 해봤 음모
설치하지만 엄청난 오류 얻을 :Failed to install random-1.0.1.1
Last 10 lines of the build log (/Users/mikeecb/.cabal/logs/random-1.0.1.1.log):
cabal: Error: some packages failed to install:
random-1.0.1.1 failed during the configure step. The exception was:
user error (In file included from
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Rts.h:30,
from
/var/folders/lw/mwgzrbns2j10_p75xtydr9_r0000gn/T/ghc3806_0/ghc3806_0.c:1:0:
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Stg.h:65:18:
error: math.h: No such file or directory
In file included from
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Rts.h:32,
from
/var/folders/lw/mwgzrbns2j10_p75xtydr9_r0000gn/T/ghc3806_0/ghc3806_0.c:1:0:
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/HsFFI.h:30:20:
error: stdint.h: No such file or directory
In file included from
/var/folders/lw/mwgzrbns2j10_p75xtydr9_r0000gn/T/ghc3806_0/ghc3806_0.c:1:0:
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Rts.h:190:20:
error: stdlib.h: No such file or directory
In file included from
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Rts.h:227,
from
/var/folders/lw/mwgzrbns2j10_p75xtydr9_r0000gn/T/ghc3806_0/ghc3806_0.c:1:0:
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/rts/Flags.h:17:19:
error: stdio.h: No such file or directory
In file included from
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Rts.h:227,
from
/var/folders/lw/mwgzrbns2j10_p75xtydr9_r0000gn/T/ghc3806_0/ghc3806_0.c:1:0:
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/rts/Flags.h:22:0:
error: expected specifier-qualifier-list before ‘FILE’
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/rts/Flags.h:188:0:
error: expected specifier-qualifier-list before ‘FILE’
In file included from
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Rts.h:234,
from
/var/folders/lw/mwgzrbns2j10_p75xtydr9_r0000gn/T/ghc3806_0/ghc3806_0.c:1:0:
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/rts/Threads.h:19:23:
error: sys/types.h: No such file or directory
In file included from
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/Rts.h:234,
from
/var/folders/lw/mwgzrbns2j10_p75xtydr9_r0000gn/T/ghc3806_0/ghc3806_0.c:1:0:
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/include/rts/Threads.h:49:0:
error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘forkProcess’
)
파일을 수동으로 복사 할 필요가 없습니다. 컴파일러는 파일을 올바르게 찾을 수 없습니다. 당신은'무작위'를 haskell 플랫폼으로 설치 했습니까? 아니면'cabal install'을 사용 했습니까? – bheklilr
나는 cabal install random을 사용했습니다 –
어떻게'ghc'와'cabal'을 설치 했습니까? 어떤 OS를 실행하고 있습니까? – bheklilr