SHGetFolderPath requiered to configure cabal on windows #318

bos opened this Issue May 24, 2012 · 6 comments

2 participants


(Imported from Trac #325, reported by guest on 2008-08-16)

i try to install cabal with ghc 6.8.3 on XP.
i get the error message
GHCi could not find the following symbols

i saw some old bugs mentioning this problem - what is a current fix?


(Imported comment by @dcoutts on 2008-08-16)

The README file suggests:

    ghc --make Setup
./Setup configure --user
./Setup build
./Setup install
The reason it imports SHGetFolderPath is to find the location of the Program Files directory. Unfortunately that is not provided by either System.Directory or anything in the Win32 binding package so we have to directly FFI import that ourselves. Unfortunately ghci does not know to link in the appropriate dll (and there's no automatic way for us to tell it) so Cabal will not work in ghci by default. You can either compile it (because gcc does link in the lib by default) or add something like -lshell32 when invoking ghci/runghc.

So I don't see any obvious solutions at the moment. If the Win32 or directory package provided what we need then that'd be a great improvement.

Unless someone can see a solution I'm missing I'll have to mark this bug 'wontfix'.


(Imported comment by guest on 2008-08-16)

I'd suggest a documentation fix, at least. I read those instructions but assumed "runhaskell/runghc" would be no different. Mentioning the issue in a README would be good.


(Imported comment by @dcoutts on 2008-09-28)

I added:

Compiling Setup rather than using runghc Setup is much faster and works on
Windows. For all packages other than Cabal itself it is fine to use runghc.
Again, the longer term solution is to get these functions added to the Win32 package.


(Imported comment by @dcoutts on 2008-10-09)

This really isn't that hard. It just needs someone to bind these SHGetFolderPath functions and CLSID values etc in the Win32 package.

Need a Windows volunteer.


(Imported comment by @dcoutts on 2009-03-09)

SHGetFolderPath is now bound in the System.Win32 module so this is now really easy. Just need someone to do it and test it.

Haskell member

Closing as there's been no activity in years.

We're cleaning up the bug tracker to make it useful again and are thus closing bugs that haven't seen any activity in a long time. Please re-open (or file a new bug) if the problem reappears.

@tibbe tibbe closed this May 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment