[Haskell-cafe] Another topic of ghc --make/ghci differences

Andrey Yankin yankin013 at gmail.com
Thu Jul 12 19:31:58 CEST 2012


OK
This is my answer:
http://stackoverflow.com/questions/7867290/freeglut-does-not-work-in-ghci
Linux Nvidia drivers doesn't work with ghci somehow...


2012/7/12 Andrey Yankin <yankin013 at gmail.com>

> 1. I wrote this:
> -----8<----- test.hs ---
>   module Main where
>   import qualified Graphics.UI.GLFW as GLFW
>   main = do
>     True <- GLFW.initialize
>     print =<< GLFW.openGLProfile
>     print =<< GLFW.getGlfwVersion
>     print =<< GLFW.getGlVersion
>     print "Trying to open the window"
>     result <- GLFW.openWindow GLFW.defaultDisplayOptions
>     print result
> -----8<-----
>
> 2. Compiled like this: ghc --make -o test test.hs
> 3. Executed: ./test
>   DefaultProfile
>   Version {versionBranch = [2,7,2], versionTags = []}
>   Version {versionBranch = [0,0,0], versionTags = []}
>   "Trying to open the window"
>   True
> 4. Window appeared.
>
> 2'. Executed in GHCI like this:
>   ghci -fno-ghci-sandbox
>   Prelude> :l test.hs
>   Prelude> main
> 3'. Get (random numbers as GLVersion):
>   Loading package GLFW-b-0.1.0.2 ... linking ... done.
>   DefaultProfile
>   Version {versionBranch = [2,7,2], versionTags = []}
>   Version {versionBranch = *[34972080,-1323041296,-1334802519]*,
> versionTags = []}
>   "Trying to open the window"
>   False
> 4'. Window didn't appear.
>
> What should I do to get GLFW window in ghci too?
> What do I do wrong?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120712/739870ee/attachment.htm>


More information about the Haskell-Cafe mailing list