我用“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程序?
答案 0 :(得分:1)
根据我的经验,这似乎与在Linux中使用Nvidia驱动程序有关。我对这个特殊问题的体验仅限于Ubuntu 11.04,我可以通过卸载专有驱动程序来解决这个错误。