cq3a on mac
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):
Then I tried to do a make, and got this result:
Any thoughts?
Code:
# GLUT (OS X)
MAINOBJ = uiglut.o
MAININC = -F/System/Library/Frameworks/GLUT.framework
MAINLIB = -framework GLUTCode:
# 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 = ccThen 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 1Any thoughts?
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
Try changing it to GL_REFLECTION_MAP_ARB and see what happens?
- Alex Diener
Alex, thanks for your reply.
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?
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?
/System/Library/Frameworks/OpenGL.framework/Headers/glext.h
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/
http://glew.sourceforge.net/
Thanks ThemsAllTook and OneSadCookie. I seem to have made some progress by changing that in renderback.c. Now I get a new error:
Now to figure out why my email notifications aren't getting through...
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 1Now to figure out why my email notifications aren't getting through...
Just link against Cocoa. I used to get those errors with GLUT apps all the time.
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?
I don't know much about the autoconf/makefile syntax cq3a is using, but the line in your first post:
Could probably be replaced with something like:
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.
Code:
MAINLIB = -framework GLUTCould probably be replaced with something like:
Code:
MAINLIB = -framework GLUT -framework CocoaSyntax 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.

