The Castle Doctrine Forums

Discuss the massively-multiplayer home defense game.

You are not logged in.

#1 Re: Main Forum » opengl issues compiling on mac osx? » 2014-04-02 12:41:57

iceman wrote:

I'm pretty sure TCD doesn't use SDL 2, just plain ole SDL.  Try installing that and see if it works. (I don't think there's a Mac dev version, but if you install just the normal version, it should work).

i got the old sdl too and it still won't work. i think the problem is opengl.

jasonrohrer wrote:

Yeah, I think the OpenGL headers have moved in later versions of OSX.  I'm building on 10.5, which I think had them in an OpenGL/ folder (this is not standard, usually they are in a gl/ folder).
So, I created  minorGems/graphics/openGL/glInclude.h  to deal with the mess of finding the OpenGL headers.
You'll probably have to edit that file in the $ifdef __mac__ section to tell it where to look for those headers.  Maybe just remove the OpenGL/ part... maybe <gl.h> and <glu.h> will work?

the problem i was running into was that the files were located in the folder /opengl.framework/, not just /opengl/. i changed glinclude to look for the headers at <openGL.framework/gl.h> and the previous errors are gone.

i also replaced my opengl framework with the developer one from the osx 10.6 sdk. now it works fine. thanks jason!

#2 Main Forum » opengl issues compiling on mac osx? » 2014-04-01 19:03:08

Epsilon
Replies: 3

i'm compiling a client on mac osx and have been getting an error from lots of the files in the opengl folder in the graphics folder in minorGems. i'm using osx 10.6.9 (snow leapord) with the gcc, and have the opengl and sdl 2.0 libraries installed properly (in system/library/frameworks). here are some of the errors

first the glInclude file is messed up and can't find gl.h or glu.h. this might be why the other stuff after it isn't working
then a lot of stuff is "not declared in this scope"

Building CastleDoctrine...
g++  -Wall -Wwrite-strings -Wchar-subscripts -Wparentheses -gstabs+  -DBSD -D__mac__ -I/System/Library/Frameworks/OpenGL.framework/Headers  -O0 -I../.. -c -o ../../minorGems/graphics/openGL/ScreenGL_SDL.o ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp
In file included from ../../minorGems/graphics/openGL/SingleTextureGL.h:34,
                 from ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:138:
../../minorGems/graphics/openGL/glInclude.h:3:23: error: OpenGL/gl.h: No such file or directory
../../minorGems/graphics/openGL/glInclude.h:4:24: error: OpenGL/glu.h: No such file or directory
In file included from ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:138:
../../minorGems/graphics/openGL/SingleTextureGL.h:173: error: ‘GLuint’ does not name a type
../../minorGems/graphics/openGL/SingleTextureGL.h: In member function ‘void SingleTextureGL::enable()’:
../../minorGems/graphics/openGL/SingleTextureGL.h:204: error: ‘GL_TEXTURE_2D’ was not declared in this scope
../../minorGems/graphics/openGL/SingleTextureGL.h:204: error: ‘glEnable’ was not declared in this scope
../../minorGems/graphics/openGL/SingleTextureGL.h:205: error: ‘mTextureID’ was not declared in this scope
../../minorGems/graphics/openGL/SingleTextureGL.h:205: error: ‘glBindTexture’ was not declared in this scope
../../minorGems/graphics/openGL/SingleTextureGL.h:207: error: ‘glGetError’ was not declared in this scope
../../minorGems/graphics/openGL/SingleTextureGL.h:208: error: ‘GL_NO_ERROR’ was not declared in this scope
../../minorGems/graphics/openGL/SingleTextureGL.h: In member function ‘void SingleTextureGL::disable()’:
../../minorGems/graphics/openGL/SingleTextureGL.h:217: error: ‘GL_TEXTURE_2D’ was not declared in this scope
../../minorGems/graphics/openGL/SingleTextureGL.h:217: error: ‘glDisable’ was not declared in this scope
In file included from ../../minorGems/io/file/File.h:108,
                 from ../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:154:
../../minorGems/io/file/Path.h: In constructor ‘Path::Path(const char*)’:
../../minorGems/io/file/Path.h:421: warning: allocating zero-element array
../../minorGems/io/file/Path.h:422: warning: allocating zero-element array
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp: In member function ‘void ScreenGL::setupSurface()’:
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:887: error: ‘GL_DEPTH_TEST’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:887: error: ‘glEnable’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:888: error: ‘GL_CULL_FACE’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:889: error: ‘GL_BLEND’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:890: error: ‘GL_SRC_ALPHA’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:890: error: ‘GL_ONE_MINUS_SRC_ALPHA’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:890: error: ‘glBlendFunc’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:891: error: ‘GL_BACK’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:891: error: ‘glCullFace’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:892: error: ‘GL_CCW’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:892: error: ‘glFrontFace’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp: In member function ‘void ScreenGL::applyViewTransform()’:
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:1955: error: ‘GL_PROJECTION’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:1955: error: ‘glMatrixMode’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:1957: error: ‘glLoadIdentity’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:1962: error: ‘gluPerspective’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:1966: error: ‘GL_MODELVIEW’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:1991: error: ‘gluLookAt’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp: In function ‘void callbackResize(int, int)’:
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2017: error: ‘glViewport’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp: In function ‘void callbackPreDisplay()’:
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2414: error: ‘GL_COLOR_BUFFER_BIT’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2414: error: ‘GL_DEPTH_BUFFER_BIT’ was not declared in this scope
../../minorGems/graphics/openGL/ScreenGL_SDL.cpp:2414: error: ‘glClear’ was not declared in this scope
make: *** [../../minorGems/graphics/openGL/ScreenGL_SDL.o] Error 1


i think the problem is that it can't find gl.h or glu.h even though i have opengl installed and the other stuff is because of that first problem.
can anybody help?

Board footer

Powered by FluxBB 1.5.8