WxHaskell/Building with styledTextCtrl support

From HaskellWiki
Jump to navigation Jump to search

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


1) Reinstall wxcore with this additional flag:

> cabal install wxcore --ghc-options="-DwxUSE_STC=1 -optc-DwxUSE_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)