Wednesday, April 28, 2010

WXWidgets and WxHaskell on Windows, check!

Despite my earlier problems, I finally managed to install WXWidgets and WxHaskell on my Windows machine. Pfiu! I started again from scratch, and things went much better when I installed, as recommended, MinGW and MSYS in different folders. When I need to compile stuff, I only put MinGW in my path, and when I need Unixy tools like make I add MSYS. Of course MinGW has its own version of make, mingw32-make, that works when MSYS make doesn't...

So I installed MinGW in c:\dev\MinGW and:
set PATH=c:\dev\MinGW\bin;c:\dev\MinGW\libexec\gcc\mingw32\3.4.5;%PATH%

Then I modified the WxWidgets config.gcc file to set SHARED=1 UNICODE=1 MONOLITHIC=1.
And then:
mingw32-make -f makefile.gcc BUILD=debug

Setting new environment variables (wxWidgets is installed in c:\ui):
set WXWIN=c:\ui\wxWidgets-2.8.10
set WXCFG=gcc_dll\mswud

Then I could install then wxdirect, wxcore and wx packages using a few more flags than what a default cabal install would do, for example:
runhaskell Setup configure --extra-lib-dirs=c:\dev\MinGW\lib --extra-include-dirs=c:\dev\MinGW\include --extra-include-dirs=c:\dev\MinGW\include\c++\3.4.5\mingw32 --extra-include-dirs=c:\ui\wxWidgets-2.8.10\include --extra-include-dirs=c:\dev\MinGW\include\c++\3.4.5

And it install, and works!


Claudia Albornoz said...

Necesito ayuda para instalar wxhaskell en windows (XP y Vista). Desde ya muchas gracias.

bem vindo!! said...
This comment has been removed by the author.
bem vindo!! said...

I'm having trouble installing the wxHaskell in windows seven. You have to help me?

JP Moresmau said...

Well no, I don't HAVE to help you :-p. But I could, if you were so kind as to actually say what the issue is, and when in the process I outline it happens.

bem vindo!! said...

First I would like to thank you for answering, I'm needing to do a job that university, and wanted to apologize for any spelling error, I'm using the help of Google translation tool.
When I run "cabal install wx" the following message appears: "Resolving dependencies ...
cabal: Couldn` t read cabal file "Cabal \ \ 1.18.0 \ \ Cabal.cabal""
O que poderia ser o problema?

JP Moresmau said...

I don't think that's a wx specific issue. try to install something simple and see if it works. like "cabal install split". I'd say it won't. You seem to use the latest version of Cabal. If you're new to Haskell I suggest you install the Haskell platform and do not try to install a newer version of cabal. Otherwise, ask your question on Stack Overflow or on the Haskell Cafe list.