glfw 在 linux 的 sublime text 中不工作

glfw not working in sublime text in linux

当我 运行 它说的代码时

Segmentation fault (core dumped)
[Finished in 1.5s with exit code 139]

我不知道该怎么做,但我删除了它运行没有崩溃

unsigned int buffer;
glGenBuffers(1, &buffer);
glBindBuffer(GL_ARRAY_BUFFER, buffer);
glBufferData(GL_ARRAY_BUFFER,6* sizeof(float), posotions, GL_STATIC_DRAW);

您没有初始化 GLEW。可以用glewInit();

来完成

GLEW 是为您提供那些 OpenGL 函数的库。