Macos 有可能在Mac OS X上构建FreeGLUT吗?
我在用这个 这是您在mac上构建和安装它的方式:Macos 有可能在Mac OS X上构建FreeGLUT吗?,macos,opengl,makefile,freeglut,Macos,Opengl,Makefile,Freeglut,我在用这个 这是您在mac上构建和安装它的方式: CPPFLAGS="-I/usr/X11R6/include" ./configure --prefix="${PWD}/../" make make install 不幸的是,当我执行make命令时,这本身就给了我一个错误:架构x86\u 64的未定义符号 在做了一些工作后,我发现第一行的改进是: CPPFLAGS="-I/usr/X11R6/include -L/usr/X11R6/lib" LDFLAGS="-L/usr/X11R6/li
CPPFLAGS="-I/usr/X11R6/include" ./configure --prefix="${PWD}/../"
make
make install
不幸的是,当我执行make
命令时,这本身就给了我一个错误:架构x86\u 64的未定义符号
在做了一些工作后,我发现第一行的改进是:
CPPFLAGS="-I/usr/X11R6/include -L/usr/X11R6/lib" LDFLAGS="-L/usr/X11R6/lib" ./configure --prefix="${PWD}/../"
不幸的是,当我执行make
命令时,我仍然得到一个错误:
gcc -DHAVE_CONFIG_H -I. -I../../.. -I/usr/X11R6/include -L/usr/X11R6/lib -I../../../include -g -O2 -Wall -pedantic -MT smooth_opengl3-smooth_opengl3.o -MD -MP -MF .deps/smooth_opengl3-smooth_opengl3.Tpo -c -o smooth_opengl3-smooth_opengl3.o `test -f 'smooth_opengl3.c' || echo './'`smooth_opengl3.c
smooth_opengl3.c:101: error: redefinition of typedef ‘PFNGLGENBUFFERSPROC’
/usr/X11R6/include/GL/glext.h:5080: error: previous declaration of ‘PFNGLGENBUFFERSPROC’ was here
smooth_opengl3.c:102: error: redefinition of typedef ‘PFNGLBINDBUFFERPROC’
/usr/X11R6/include/GL/glext.h:5078: error: previous declaration of ‘PFNGLBINDBUFFERPROC’ was here
smooth_opengl3.c:103: error: redefinition of typedef ‘PFNGLBUFFERDATAPROC’
/usr/X11R6/include/GL/glext.h:5082: error: previous declaration of ‘PFNGLBUFFERDATAPROC’ was here
smooth_opengl3.c:104: error: redefinition of typedef ‘PFNGLCREATESHADERPROC’
/usr/X11R6/include/GL/glext.h:5197: error: previous declaration of ‘PFNGLCREATESHADERPROC’ was here
smooth_opengl3.c:105: error: redefinition of typedef ‘PFNGLSHADERSOURCEPROC’
/usr/X11R6/include/GL/glext.h:5222: error: previous declaration of ‘PFNGLSHADERSOURCEPROC’ was here
smooth_opengl3.c:106: error: redefinition of typedef ‘PFNGLCOMPILESHADERPROC’
/usr/X11R6/include/GL/glext.h:5195: error: previous declaration of ‘PFNGLCOMPILESHADERPROC’ was here
smooth_opengl3.c:107: error: redefinition of typedef ‘PFNGLCREATEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5196: error: previous declaration of ‘PFNGLCREATEPROGRAMPROC’ was here
smooth_opengl3.c:108: error: redefinition of typedef ‘PFNGLATTACHSHADERPROC’
/usr/X11R6/include/GL/glext.h:5193: error: previous declaration of ‘PFNGLATTACHSHADERPROC’ was here
smooth_opengl3.c:109: error: redefinition of typedef ‘PFNGLLINKPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5221: error: previous declaration of ‘PFNGLLINKPROGRAMPROC’ was here
smooth_opengl3.c:110: error: redefinition of typedef ‘PFNGLUSEPROGRAMPROC’
/usr/X11R6/include/GL/glext.h:5223: error: previous declaration of ‘PFNGLUSEPROGRAMPROC’ was here
smooth_opengl3.c:111: error: redefinition of typedef ‘PFNGLGETSHADERIVPROC’
/usr/X11R6/include/GL/glext.h:5209: error: previous declaration of ‘PFNGLGETSHADERIVPROC’ was here
smooth_opengl3.c:112: error: redefinition of typedef ‘PFNGLGETSHADERINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5210: error: previous declaration of ‘PFNGLGETSHADERINFOLOGPROC’ was here
smooth_opengl3.c:113: error: redefinition of typedef ‘PFNGLGETPROGRAMIVPROC’
/usr/X11R6/include/GL/glext.h:5207: error: previous declaration of ‘PFNGLGETPROGRAMIVPROC’ was here
smooth_opengl3.c:114: error: redefinition of typedef ‘PFNGLGETPROGRAMINFOLOGPROC’
/usr/X11R6/include/GL/glext.h:5208: error: previous declaration of ‘PFNGLGETPROGRAMINFOLOGPROC’ was here
smooth_opengl3.c:115: error: redefinition of typedef ‘PFNGLGETATTRIBLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5206: error: previous declaration of ‘PFNGLGETATTRIBLOCATIONPROC’ was here
smooth_opengl3.c:116: error: redefinition of typedef ‘PFNGLVERTEXATTRIBPOINTERPROC’
/usr/X11R6/include/GL/glext.h:5280: error: previous declaration of ‘PFNGLVERTEXATTRIBPOINTERPROC’ was here
smooth_opengl3.c:117: error: redefinition of typedef ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’
/usr/X11R6/include/GL/glext.h:5202: error: previous declaration of ‘PFNGLENABLEVERTEXATTRIBARRAYPROC’ was here
smooth_opengl3.c:118: error: redefinition of typedef ‘PFNGLGETUNIFORMLOCATIONPROC’
/usr/X11R6/include/GL/glext.h:5212: error: previous declaration of ‘PFNGLGETUNIFORMLOCATIONPROC’ was here
smooth_opengl3.c:119: error: redefinition of typedef ‘PFNGLUNIFORMMATRIX4FVPROC’
/usr/X11R6/include/GL/glext.h:5242: error: previous declaration of ‘PFNGLUNIFORMMATRIX4FVPROC’ was here
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
这一直是,但解决方案在这种情况下并没有真正的帮助。我还尝试将其替换为OS X附带的GLUT.framwork,但示例中使用的是FreeGLUT特定的函数。在Xquartz的邮件列表中,FreeGLUT演示程序两次声明这些PFN*PROC是错误的
因此,只要从smooth_opengl3.c中注释掉那些双重定义,免费的glut就可以通过编译阶段。然而,根据我的经验,它不会运行,并给出一些关于GLSL的错误
还有人建议在Mac OS X上,XQuartz 2.7.2替换为FreeGLUT(2.8.0),而不是旧的MesaGLUT。因此,如果您有OSX版本10.6.3或更高版本,您可以只安装XQuartz 2.7.2或更高版本。见:
./configure CFLAGS="-I/usr/X11/include/X11/extensions -L/usr/X11/lib" LIBS="-lXrandr -lXxf86vm -lXi" --with-x --x-includes=/usr/X11/include
好的,我在这方面还有一点进展。使用
CPPFLAGS=“-I/usr/X11R6/include-L/usr/X11R6/lib”。/configure--prefix=“${PWD}/./”
摆脱“未定义符号”错误。但是现在我得到了ld:library-not found for-lGL
\collect2:ld返回了1个退出状态
\make[2]:***[libglut.la]错误1
\make[1]:***[all recursive]错误1
make:**[all]错误2也许你也应该用LDFLAGS检查一下,需要使用-L/usr/X11R6/lib
。噢,谢谢。好的,所以我使用了CPPFLAGS=“-I/usr/X11R6/include-L/usr/X11R6/lib”LDFLAGS=“-L/usr/X11R6/lib”。/configure--prefix=“${PWD}/。/”
,我消除了前面的错误。现在,我得到了大量的错误,这些错误都是沿着smooth\u opengl3.c:101:error:typedef'PFNGLGENBUFFERSPROC'的重新定义\/usr/X11R6/include/GL/glext.h:5080:error:PFNGLGENBUFFERSPROC'之前的声明在这里
您是否会相应地更新您的问题,以便我开始回答?本网站不建议对对话发表过多评论。不幸的是,OSX的GLUT框架不支持OpenGL 3.2。对于那些想知道如何在XCode中设置freeglut的人,请参阅