I start a new haskell project and make two files
module Foo where ...
module Bar where
import Foo ...
The above builds with no errors (for all well defined modules Foo and Bar). The trouble comes for me with loading Bar. If I load Bar in hugs from eclipse, fine no problem, but if i load Bar in GHCi, I get the error,
"could not find module 'Foo', Use -v to see a list of the files searched for."
Then I open a terminal and change into the directory, and
"GHCi Bar", and the file is loaded and linked no problem. I don't mind using hugs, but for things like graphics it is inadequate. I have tried enabling the checkbox for use ghc compiler settings for ghci, under windows>preferences>functional programming>interpreter>gchi but that did not help. Is there a way to get these files to load from inside EclipseFP?
In case it helps, I use Ubuntu 8.04, and installed both hugs and GHC through apt-get. Also, the output from ghc-pkg -l is
" Cabal-22.214.171.124, GLFW-0.3, OpenGL-126.96.36.199, QuickCheck-188.8.131.52,
WordNet-0.1.2, array-0.1.0.0, base-184.108.40.206, bytestring-0.9.0.1,
containers-0.1.0.1, directory-220.127.116.11, filepath-18.104.22.168,
(ghc-6.8.2), haskell98-22.214.171.124, hpc-0.5.0.0, mtl-126.96.36.199,
old-locale-188.8.131.52, old-time-184.108.40.206, packedstring-0.1.0.0,
parsec-220.127.116.11, pretty-18.104.22.168, process-22.214.171.124, random-126.96.36.199,
readline-188.8.131.52, rts-1.0, template-haskell-184.108.40.206, unix-220.127.116.11
By the way, I really like the eclipsefp environment, and thank you for your past help.
This looks like a difference in search path handling: ghc (when compiling, for which eclipsefp uses --make) and hugs seem to be more explorative. You could try to add -i. (note the dot) to the command line options in the preferences. Another thing that might help would be to open the launch config dialog (in the Run ... menu) after you have run ghci once, and set the work directory to the source folder. (I think in EclipseFP 2 the source folder is automatically put on the search path when running ghci).
Thanks && ciao,
i experience similar problems. it seems that the search path is not set automatically to search the current directory.
what i do is to add to the project properties the current directory (where the workspace, then the project, then the src ) as library to search.
then close the workspace and open it again. for me then ghc works. and the setting is remembered and need not be changed untill you need to search files from another project, then add the source directory from this one as well. (and cloose/open workspace)
hope this is clear enough and helps you!
thank you that helps
Mentioning EclipseFP2, is there a release date? I tried installing the build and it seemed very nice; however, I get a cabal-builder error every time I hit save. Is there a library I am missing?
Scratch that last comment, I just did a fresh install of EclipseFp2 on a fresh eclipse, and there are no errors.
Log in to post a comment.