[Haskell-cafe] Problem installing Cabal- with ghc-6.8.3

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Jun 25 05:33:46 EDT 2008

On Wed, 2008-06-25 at 10:15 +0200, Sasko Mateski wrote:
> I wanted to install cabal-install to check it out. Soon I found out
> that it has a dependency on Cabal (>=1.4&&<1.5), so next thing to do
> was getting and installing Cabal- (since the version coming
> with  ghc-6.8.3 is But during the configuration part of the
> installation I got the following error:
> During interactive linking, GHCi couldn't find the following symbol:
>   SHGetFolderPathA at 20
> This may be due to you not asking GHCi to load extra object files,

Instead of using runghc Setup.hs configure, use:

ghc --make Setup.hs
Setup.exe configure
Setup.exe build
Setup.exe install

(This is documented in the README in the Cabal package tarball)

That way you are compiling Setup.hs using ghc rather than running it
using ghci. The problem is that on Windows Cabal needs to use some Win32
FFI calls and ghci doesn't know about the libs we are linking to.

You only have to use this workaround when installing Cabal itself (and
only on Windows). Once it's installed the runghc method works for all
other packages.

Even better, once you've got cabal-install working there'll be no need
for this kind of fiddling at all as cabal-install will compile Setup.hs
automatically (if that's necessary, often it can do it directly without
compiling Setup.hs at all).


More information about the Haskell-Cafe mailing list