user1009658
user1009658

Reputation: 39

FreeGlut does not work in ghci

I wrote a small program using the "Glut"

import Graphics.Rendering.OpenGL 
import Graphics.UI.GLUT
main = do 
  (progname, _) <- getArgsAndInitialize
  createWindow "Hello World"
  mainLoop

The program, compiled by GHC runs fine (ghc --make t.hs), but when I try to run the program from ghci, ghci crashes with message:

freeglut (<interactive>):  ERROR:  Internal error 
<FBConfig with necessary capabilities not found> in function fgOpenWindow
  X Error of failed request:  BadWindow (invalid Window parameter)
  Major opcode of failed request:  4 (X_DestroyWindow)
  Resource id in failed request:  0x0
  Serial number of failed request:  33
  Current serial number in output stream:  36

Is it possible to run a Glut program from ghci?

Upvotes: 1

Views: 663

Answers (1)

Karl
Karl

Reputation: 1153

In my experience this seems to be related to using the Nvidia drivers in Linux. My experience with this particular problem is limited to Ubuntu 11.04, in which I can remedy this error by uninstalling the proprietary drivers.

Upvotes: 1

Related Questions