PDA

View Full Version : cq3a on mac


noahwf
2004.11.09, 04:23 PM
I'm trying to get Cave Quake III Arena (http://www.visbox.com/cq3a/) running on my Mac. It has a Mac-friendly make file, within which I uncommented these options (while commenting out the Linux defaults):

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

# 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:

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?

ThemsAllTook
2004.11.09, 04:49 PM
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

noahwf
2004.11.09, 05:40 PM
Alex, thanks for your reply.

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?

OneSadCookie
2004.11.09, 05:51 PM
/System/Library/Frameworks/OpenGL.framework/Headers/glext.h

TomorrowPlusX
2004.11.09, 06:50 PM
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/

noahwf
2004.11.10, 08:46 AM
Thanks ThemsAllTook and OneSadCookie. I seem to have made some progress by changing that in renderback.c. Now I get a new error:

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...

TomorrowPlusX
2004.11.10, 12:38 PM
Just link against Cocoa. I used to get those errors with GLUT apps all the time.

noahwf
2004.11.10, 02:18 PM
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?

TomorrowPlusX
2004.11.10, 03:35 PM
I don't know much about the autoconf/makefile syntax cq3a is using, but the line in your first post:

MAINLIB = -framework GLUT

Could probably be replaced with something like:

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.

noahwf
2004.11.10, 07:44 PM
That did it. Thanks!