2011-12-17 3 views
18

나는 src 디렉토리가 있습니다. 이 디렉토리에는 Main.hs 파일과 Test 디렉토리가 있습니다. Test 디렉토리에는 Test.hs 모듈이 있습니다. 나는 음모로 그것을 컴파일해야합니다. 나는 그것이 OK입니다 cabal configure을 수행 할 때카발 : 소스로 빌드 디렉토리

Executable main 
    -- .hs or .lhs file containing the Main module. 
     Main-is: src/Main.hs 

-- Modules not exported by this package. 
    Other-modules: Test.Test 

을,하지만 난 cabal build하려 할 때 다음과 같은 오류 얻을 : 내 음모 파일에서

내가 가진

cabal build 
Preprocessing executables for main-0.0.1... 
cabal: can't find source for Test/Test in ., dist/build/autogen 

Main.hs과을 사용하여 다른 디렉토리를 올바르게 빌드하려면 어떻게해야합니까?파일?

감사합니다. Test.Testsrc/Test/Test.hs에 정의되어있는 경우

답변

22

, 당신은 당신의 음모 파일의 실행 섹션에서

hs-source-dirs: src 

이 필요합니다. main-is 파일 경로는 원본 디렉토리와 관련이 있어야하므로이 경우 Main.hs으로 변경해야합니다.

관련 문제