1

我用“Glut”写了一个小程序

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

由 GHC 编译的程序运行良好(ghc --make t.hs),但是当我尝试从 ghci 运行程序时,ghci 崩溃并显示以下消息:

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

是否可以从 ghci 运行 Glut 程序?

4

1 回答 1

1

以我的经验,这似乎与在 Linux 中使用 Nvidia 驱动程序有关。我对这个特定问题的经验仅限于 Ubuntu 11.04,我可以通过卸载专有驱动程序来纠正这个错误。

于 2011-10-28T20:00:37.573 回答