FreeGlut 在 ghci 中不起作用

发布于 2024-12-11 14:26:45 字数 731 浏览 1 评论 0原文

我使用“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

Is it possible to run a 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意中人 2024-12-18 14:26:45

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

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文