cq3a on mac

noahwf
Unregistered
 
Post: #1
I'm trying to get Cave Quake III Arena running on my Mac. It has a Mac-friendly make file, within which I uncommented these options (while commenting out the Linux defaults):

Code:
# GLUT (OS X)
MAINOBJ = uiglut.o
MAININC = -F/System/Library/Frameworks/GLUT.framework
MAINLIB = -framework GLUT


Code:
# OS X
INC = -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include
LIB = -L/usr/local/lib
EXLIBS = -framework OpenGL
OPT =
DEFS = -DASHOCK_BIG_ENDIAN -DMACOSX
CC = cc


Then I tried to do a make, and got this result:

Code:
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c util.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c bsp.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c vec.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c render.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c tex.c
tex.c: In function `tex_bindobjs':
tex.c:158: warning: passing arg 2 of `glGenTextures' from incompatible pointer type
tex.c: In function `tex_freeobjs':
tex.c:185: warning: passing arg 2 of `glDeleteTextures' from incompatible pointer type
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c lightmap.c
lightmap.c: In function `lightmap_bindobjs':
lightmap.c:58: warning: passing arg 2 of `glGenTextures' from incompatible pointer type
lightmap.c: In function `lightmap_freeobjs':
lightmap.c:82: warning: passing arg 2 of `glDeleteTextures' from incompatible pointer type
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c mesh.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c pak.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c shader.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c renderback.c
renderback.c: In function `render_setstate':
renderback.c:802: error: `GL_REFLECTION_MAP_EXT' undeclared (first use in this function)
renderback.c:802: error: (Each undeclared identifier is reported only once
renderback.c:802: error: for each function it appears in.)
make: *** [renderback.o] Error 1

Any thoughts?
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
Looking at glext.h, there are 3 GL_REFLECTION_MAP_* constans: GL_REFLECTION_MAP_ARB, GL_REFLECTION_MAP_NV, and GL_REFLECTION_MAP_EXT. The first two get defined, but the third doesn't, because it's surrounded by #if GL_EXT_texture_cube_map .. #endif, and GL_EXT_texture_cube_map is not defined to 1.

Try changing it to GL_REFLECTION_MAP_ARB and see what happens?

- Alex Diener
Quote this message in a reply
noahwf
Unregistered
 
Post: #3
Alex, thanks for your reply.

ThemsAllTook Wrote:Looking at glext.h

Unfortunately, I don't find a file with this name in the cq3a directory, or elsewhere on my Mac. Am I looking for the wrong thing? Or, could the fact that it's not there be part of my problem?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
/System/Library/Frameworks/OpenGL.framework/Headers/glext.h
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #5
While it might take a lot of editing of the source, I've found GLEW to be paritcularly useful for getting OpenGL code written on Windows/Linux machines to work well on OS X.

http://glew.sourceforge.net/
Quote this message in a reply
noahwf
Unregistered
 
Post: #6
Thanks ThemsAllTook and OneSadCookie. I seem to have made some progress by changing that in renderback.c. Now I get a new error:

Code:
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c renderback.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c skybox.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c entity.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c md3.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c mapent.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c uicommon.c
uicommon.c: In function `ui_init_gl':
uicommon.c:347: warning: passing arg 2 of `glGetIntegerv' from incompatible pointer type
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c unzip.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c globalshared.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c renderhud.c
cc -F/System/Library/Frameworks/OpenGL.framework -I/usr/local/include  -DASHOCK_BIG_ENDIAN -DMACOSX -F/System/Library/Frameworks/GLUT.framework -c uiglut.c
cc  -o cq3a util.o bsp.o vec.o render.o tex.o lightmap.o mesh.o pak.o shader.o renderback.o skybox.o entity.o md3.o mapent.o uicommon.o unzip.o globalshared.o renderhud.o uiglut.o -L/usr/local/lib  -framework GLUT -framework OpenGL -lm -ljpeg -lz
ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in indirectly referenced dynamic library /usr/lib/libobjc.A.dylib
make: *** [cq3a] Error 1

Now to figure out why my email notifications aren't getting through...
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #7
Just link against Cocoa. I used to get those errors with GLUT apps all the time.
Quote this message in a reply
noahwf
Unregistered
 
Post: #8
TomorrowPlusX, that sounds like a good suggestion -- but I have little enough Mac development experience that I don't know how to implement it. Is it something you'd be willing to explain further?
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #9
I don't know much about the autoconf/makefile syntax cq3a is using, but the line in your first post:

Code:
MAINLIB = -framework GLUT

Could probably be replaced with something like:

Code:
MAINLIB = -framework GLUT -framework Cocoa

Syntax aside, that oughta do it. You're just telling it to link against Cocoa. As it stands, this app is GLUT based and clearly makes no direct calls to Cocoa or the objective-c runtime; but GLUT does, and as such you'll need to link.
Quote this message in a reply
noahwf
Unregistered
 
Post: #10
That did it. Thanks!
Quote this message in a reply
Post Reply