0

I downloaded gtk recently and wrote the following code.

main :: IO ()
main = do 
  initGUI
  window <- windowNew
  onDestroy window mainQuit
  widgetShowAll window
  mainGUI

This program results to a error message and that ghci is quitted.

0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
AllocationBase 0x68530000, BaseAddress 0x68570000, RegionSize 0x22000, State 0x1000
C:\Program Files (x86)\Haskell Platform\2014.2.0.0\bin\ghc.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0

I hope to find a solution for this problem. Thank you!

Cactus
  • 27,075
  • 9
  • 69
  • 149
scholar guy
  • 79
  • 2
  • 11
  • as you write "when run from ghci" does it work if you compile it? – epsilonhalbe Aug 13 '15 at 08:41
  • As you are running from ghci, I think you need to create a thread for gtk with `forkOS $ runInBoundThread`. See this file for a gtk library that can run in ghci: https://hackage.haskell.org/package/plot-gtk-0.2.0.2/docs/src/Graphics-Rendering-Plot-Gtk.html#PlotHandle – vivian Aug 13 '15 at 09:09

0 Answers0