Personal tools

WxHaskell/Building with styledTextCtrl support

From HaskellWiki

< WxHaskell
Revision as of 02:22, 5 February 2010 by Jcpetruzza (Talk | contribs)

Jump to: navigation, search

If you are using styledTextControl and your program crashes with some "null object" error, try the following steps (tested with wxhaskell + wxwidgets 2.8.10 on OS X):

1) Reinstall wxcore with this additional flag:

> cabal install wxcore --ghc-options="-D wxUSE_STC=1" --reinstall

2) Reinstall wx:

> cabal install wx --reinstall

If step 1 fails, that probably means you don't have installed wxwidgets installed with stc support. Try reinstalling wxwidgets passing --with-stc to configure (and don't forget to run make also from the contrib directory!)

If all the steps above succeed, you might need to pass additional libraries in order to build your application. The following worked for me:

> ghc --make my-app.hs $(wx-config --libs std,stc)