Reputation: 21817
I want to use in my haskell project xml library (http://hackage.haskell.org/package/xml)
I downloaded it.then try to build and install:
runhaskell Setup.hs configure
runhaskell Setup.hs build
runhaskell Setup.hs install
All ok. There are no errors. When i try import modules from this lib to my project, for example:
import Text.XML.Light.Cursor
I get error:
/home/shk/dev/src/XMPP.hs:8:8:
Could not find module `Text.XML.Light.Cursor':
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
What's wrong? How can i install and use library in haskell?
Thank you.
Upvotes: 1
Views: 1270
Reputation: 979
Copying from the mailing list:
First thing is to do 'ghc-pkg list'. If your package doesn't show up then it's not installed, according to the package registry. 'cabal install' should have registered it. If it is in the list, then it depends how you're building. If you use ghc manually, then you have to give '-package xyz'. If you use 'ghc --make', ghc will automatically add the -package for you. If you use cabal, you put the package in the dependencies, and 'cabal build' will add -package for you.
If the package has parens, then someone hid it, and you'll have to do 'ghc-pkg expose' on it. If you're doing everything else right and it still doesn't find the package, then you can run ghc -v and it'll print lots of details. It might have something about 'hiding xyz because of ', which means you're depending on libraries that expect different versions of the underlying library. You can sometimes get out of this by carefully upgrading or downgrading certain libraries.
Upvotes: 2