【发布时间】:2011-09-06 20:22:11
【问题描述】:
我在 OpenSuse 11.3(一个非常新的安装)中为 openGL 编写了这样的示例代码(安装了从 Yast2 的软件管理器中搜索 openGL 的所有库)。
**File: SimpleOpenGL.c**
#include <GL/glut.h>
int main(int argc,char **argv)
{
glutInit(&argc,argv);
glutInitWindowPosition(100,100);
glutInitWindowSize(800,600);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutCreateWindow("Window");
}
Compiling with : $ gcc -o foo -lGL -lglut SimpleOpenGL.c
Running with : $ ./foo
freeglut (./foo): failed to open display ''
我是否必须在 Suse 中安装任何其他库才能使其正常工作?
【问题讨论】:
-
万一,您不是坐在 OpenSuse 工作站前吗?无法打开显示通常意味着没有活动的 X 主机。
-
我在安装了 OpenSuse 11.3 的 HP 笔记本电脑上。那么,是否有任何解决方法可以绕过该问题? :(
标签: c opengl opensuse freeglut