简体   繁体   English

无法在OSX下编译OpenGL项目

[英]Can't compile OpenGL project under OSX

There's an OpenGL project I have to work on for a course I am attending. 我要参加的课程有一个OpenGL项目。 There were link errors due to GLEW. 由于GLEW,存在链接错误。 After some research, I found out that on OSX GLEW is not necessary. 经过一番研究,我发现在OSX上不需要GLEW。

I included following headers. 我包括以下标题。

//#include "CL/cl_gl.h"
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
//#include <OpenGL/glext.h> 
//#include <GLUT/glut.h>

But I am still getting compile errors of following kind: 但是我仍然收到以下类型的编译错误:

  use of undeclared identifier 'GL_TEXTURE_BUFFER_EXT'
    glBindTexture(GL_TEXTURE_BUFFER_EXT, 0);
                  ^

Where on OSX is the GLenum GL_TEXTURE_BUFFER_EXT resp. 在OSX上的是GLenum GL_TEXTURE_BUFFER_EXT。 GL_TEXTURE_BUFFER defined? GL_TEXTURE_BUFFER定义了吗?

The EXT variant will only be defined in glext.h or the headers which come or are generated by the various GL extenstion loaders. EXT变体将仅在glext.h或各种GL扩展加载程序附带或生成的标头中定义。 The actual GL_TEXTURE_BUFFER enum is defined in OpenGL/gl3.h . 实际的GL_TEXTURE_BUFFER枚举在OpenGL/gl3.h定义。 On OSX, modern GL is part of the OS, and you can directly link the modern GL funtions. 在OSX上,现代GL是操作系统的一部分,您可以直接链接现代GL功能。 However, I would still recommend using some GL loader, just for portability reasons. 但是,出于可移植性原因,我仍然建议使用某些GL加载器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM