如何在OS X Yosemite上安装FreeGlut(3.0.0或2.8.0)

4
smooth_opengl3.c:123:1: error: unknown type name 'PFNGLGENBUFFERSPROC'
PFNGLGENBUFFERSPROC gl_GenBuffers;
^
smooth_opengl3.c:124:1: error: unknown type name 'PFNGLBINDBUFFERPROC'
PFNGLBINDBUFFERPROC gl_BindBuffer;
^
smooth_opengl3.c:125:1: error: unknown type name 'PFNGLBUFFERDATAPROC'
PFNGLBUFFERDATAPROC gl_BufferData;
^
smooth_opengl3.c:126:1: error: unknown type name 'PFNGLCREATESHADERPROC'
PFNGLCREATESHADERPROC gl_CreateShader;
^
smooth_opengl3.c:127:1: error: unknown type name 'PFNGLSHADERSOURCEPROC'
PFNGLSHADERSOURCEPROC gl_ShaderSource;
^
smooth_opengl3.c:128:1: error: unknown type name 'PFNGLCOMPILESHADERPROC'
PFNGLCOMPILESHADERPROC gl_CompileShader;
^
smooth_opengl3.c:129:1: error: unknown type name 'PFNGLCREATEPROGRAMPROC'
PFNGLCREATEPROGRAMPROC gl_CreateProgram;
^
smooth_opengl3.c:130:1: error: unknown type name 'PFNGLATTACHSHADERPROC'
PFNGLATTACHSHADERPROC gl_AttachShader;
^
smooth_opengl3.c:131:1: error: unknown type name 'PFNGLLINKPROGRAMPROC'
PFNGLLINKPROGRAMPROC gl_LinkProgram;
^
smooth_opengl3.c:132:1: error: unknown type name 'PFNGLUSEPROGRAMPROC'
PFNGLUSEPROGRAMPROC gl_UseProgram;
^
smooth_opengl3.c:133:1: error: unknown type name 'PFNGLGETSHADERIVPROC'
PFNGLGETSHADERIVPROC gl_GetShaderiv;
^
smooth_opengl3.c:134:1: error: unknown type name 'PFNGLGETSHADERINFOLOGPROC'
PFNGLGETSHADERINFOLOGPROC gl_GetShaderInfoLog;
^
smooth_opengl3.c:135:1: error: unknown type name 'PFNGLGETPROGRAMIVPROC'
PFNGLGETPROGRAMIVPROC gl_GetProgramiv;
^
smooth_opengl3.c:136:1: error: unknown type name 'PFNGLGETPROGRAMINFOLOGPROC'
PFNGLGETPROGRAMINFOLOGPROC gl_GetProgramInfoLog;
^
smooth_opengl3.c:137:1: error: unknown type name 'PFNGLGETATTRIBLOCATIONPROC'
PFNGLGETATTRIBLOCATIONPROC gl_GetAttribLocation;
^
smooth_opengl3.c:138:1: error: unknown type name 'PFNGLVERTEXATTRIBPOINTERPROC'
PFNGLVERTEXATTRIBPOINTERPROC gl_VertexAttribPointer;
^
smooth_opengl3.c:139:1: error: unknown type name
      'PFNGLENABLEVERTEXATTRIBARRAYPROC'
PFNGLENABLEVERTEXATTRIBARRAYPROC gl_EnableVertexAttribArray;
^
smooth_opengl3.c:140:1: error: unknown type name 'PFNGLGETUNIFORMLOCATIONPROC'
PFNGLGETUNIFORMLOCATIONPROC gl_GetUniformLocation;
^
smooth_opengl3.c:141:1: error: unknown type name 'PFNGLUNIFORMMATRIX4FVPROC'
PFNGLUNIFORMMATRIX4FVPROC gl_UniformMatrix4fv;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[4]: *** [smooth_opengl3-smooth_opengl3.o] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

在freeglut 3.0.0中没有配置文件。当我使用(env CPPFLAGS="-I/opt/X11/include" LDFLAGS="-L/opt/X11/lib" ./configure)从这个指南编译free glut (2.8.0)时,我收到了这个错误。
与此相关的问题也没有帮助:在Mac OS X上是否可以构建FreeGLUT?

我有完全相同的问题。你最终是如何在Yosemite上安装freeGlut的? - Echo
抱歉,我不记得 @Echo。 - Kanwar Baweja
2
谢谢。最终我发现“brew install freeglut”可以在Yosemite上安装freeglut 3.0.0。它运行良好。 - Echo
1个回答

3

您可以打开progs/demos/smooth_opengl3/smooth_opengl3.c并搜索PFNGLGENBUFFERSPROC

现在注释掉#ifndef GL_VERSION_1_5#ifndef GL_VERSION_2_0语句。重新构建,错误应该会消失。


还需要为 [freeglut]/progs/demos/shapes/shapes.c 进行此操作 -- 并且请注意,"progs" 目录位于提取的 freeglut 源代码存档的基本目录中。 - user3834473
如果您在使用freeglut时遇到其他构建问题,此链接可以帮助解决所有其他问题:https://sourceforge.net/p/freeglut/bugs/218/。在安装XQuartz后进行CMAKE编辑,然后确保当“make”构建中断时,您在“[builddir]/lib/libglut.a”文件上运行“`ranlib`”命令。 - user3834473

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接