Problem compiling in Mac OSX 10.6

jamalta wrote on Friday, July 09, 2010:

Hi, I am trying to compile but I am getting an error about
kEventWindowDrawContent being undeclared. I am assuming that is because of
some issue loading the cocoa libs (if I even have them). Here is the output
from `make macosx-gcc`.

cd lib/macosx; make -f Makefile.macosx.gcc
gcc -c -I. -I… -Wall -O2 -fno-common -g -o enable.o …/enable.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o fullscreen.o …/fullscreen.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o glext.o …/glext.c
gcc -c -I. -I… -Wall -O3 -ffast-math -fno-common -g -o image.o …/image.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o init.o …/init.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o input.o …/input.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o joystick.o …/joystick.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o stream.o …/stream.c
gcc -c -I. -I… -Wall -O3 -ffast-math -fno-common -g -o tga.o …/tga.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o thread.o …/thread.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o time.o …/time.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o window.o …/window.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_enable.o macosx_enable.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_fullscreen.o
macosx_fullscreen.c
macosx_fullscreen.c: In function ‘_glfwPlatformGetVideoModes’:
macosx_fullscreen.c:86: warning: ‘CGDisplayAvailableModes’ is deprecated
(declared at /System/Library/Frameworks/ApplicationServices.framework/Framewo
rks/CoreGraphics.framework/Headers/CGDirectDisplay.h:481)
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_glext.o macosx_glext.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_init.o macosx_init.c
macosx_init.c: In function ‘_glfwPlatformInit’:
macosx_init.c:134: warning: ‘CGDisplayCurrentMode’ is deprecated (declared
at /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGra
phics.framework/Headers/CGDirectDisplay.h:507)
macosx_init.c:164: warning: implicit declaration of function
‘GetScriptVariable’
macosx_init.c:164: warning: cast to pointer from integer of different size
macosx_init.c:165: warning: implicit declaration of function ‘KeyTranslate’
macosx_init.c:166: warning: implicit declaration of function ‘UppercaseText’
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_joystick.o
macosx_joystick.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_thread.o macosx_thread.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_time.o macosx_time.c
gcc -c -I. -I… -Wall -O2 -fno-common -g -o macosx_window.o macosx_window.c
macosx_window.c: In function ‘_glfwHandleMacKeyChange’:
macosx_window.c:134: warning: implicit declaration of function ‘KeyTranslate’
macosx_window.c:135: warning: implicit declaration of function
‘UppercaseText’
macosx_window.c: In function ‘_glfwMouseEventHandler’:
macosx_window.c:248: warning: implicit declaration of function
‘ConvertEventRefToEventRecord’
macosx_window.c:249: warning: implicit declaration of function ‘FindWindow’
macosx_window.c:251: warning: implicit declaration of function ‘MenuSelect’
macosx_window.c:252: warning: implicit declaration of function ‘HiliteMenu’
macosx_window.c:341: warning: implicit declaration of function
‘GetWindowBounds’
macosx_window.c:374: error: ‘typeLongInteger’ undeclared (first use in this
function)
macosx_window.c:374: error: (Each undeclared identifier is reported only
once
macosx_window.c:374: error: for each function it appears in.)
macosx_window.c: At top level:
macosx_window.c:448: error: ‘kEventWindowDrawContent’ undeclared here (not
in a function)
macosx_window.c: In function ‘_glfwWindowEventHandler’:
macosx_window.c:466: warning: implicit declaration of function
‘GetWindowPortBounds’
macosx_window.c: In function ‘_glfwPlatformOpenWindow’:
macosx_window.c:671: warning: ‘AGLDevice’ is deprecated
macosx_window.c:671: warning: implicit declaration of function
‘GetMainDevice’
macosx_window.c:671: warning: initialization makes pointer from integer
without a cast
macosx_window.c:756: warning: implicit declaration of function
‘CreateNewWindow’
macosx_window.c:769: warning: implicit declaration of function
‘GetWindowEventTarget’
macosx_window.c:769: warning: passing argument 1 of ‘InstallEventHandler’
makes pointer from integer without a cast
macosx_window.c:783: warning: implicit declaration of function
‘SetWindowTitleWithCFString’
macosx_window.c:784: warning: implicit declaration of function
‘RepositionWindow’
macosx_window.c:788: warning: ‘aglSetDrawable’ is deprecated (declared at
/System/Library/Frameworks/AGL.framework/Headers/agl.h:313)
macosx_window.c:789: warning: implicit declaration of function
‘GetWindowPort’
macosx_window.c:789: warning: passing argument 2 of ‘aglSetDrawable’ makes
pointer from integer without a cast
macosx_window.c:805: warning: implicit declaration of function ‘ShowWindow’
macosx_window.c:865: warning: passing argument 3 of ‘CGLChoosePixelFormat’
from incompatible pointer type
macosx_window.c:880: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:893: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:900: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:901: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:902: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:903: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:904: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:905: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:906: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:907: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:908: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:909: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:910: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:911: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:912: warning: passing argument 4 of ‘CGLDescribePixelFormat’
from incompatible pointer type
macosx_window.c:926: warning:
‘CGDisplayBestModeForParametersAndRefreshRateWithProperty’ is deprecated
(declared at /System/Library/Frameworks/ApplicationServices.framework/Framewo
rks/CoreGraphics.framework/Headers/CGDirectDisplay.h:502)
macosx_window.c:939: warning: ‘CGDisplaySwitchToMode’ is deprecated
(declared at /System/Library/Frameworks/ApplicationServices.framework/Framewo
rks/CoreGraphics.framework/Headers/CGDirectDisplay.h:512)
macosx_window.c:952: warning: ‘CGLSetFullScreen’ is deprecated (declared at
/System/Library/Frameworks/OpenGL.framework/Headers/OpenGL.h:70)
macosx_window.c: In function ‘_glfwPlatformCloseWindow’:
macosx_window.c:977: warning: ‘aglSetDrawable’ is deprecated (declared at
/System/Library/Frameworks/AGL.framework/Headers/agl.h:313)
macosx_window.c:993: warning: implicit declaration of function
‘ReleaseWindow’
macosx_window.c: In function ‘_glfwPlatformSwapInterval’:
macosx_window.c:1057: warning: passing argument 3 of ‘CGLSetParameter’ from
incompatible pointer type
macosx_window.c: In function ‘_glfwMacDWSetWindowSize’:
macosx_window.c:1233: warning: implicit declaration of function ‘SizeWindow’
macosx_window.c: In function ‘_glfwMacDWSetWindowPos’:
macosx_window.c:1242: warning: implicit declaration of function ‘MoveWindow’
macosx_window.c: In function ‘_glfwMacDWIconifyWindow’:
macosx_window.c:1251: warning: implicit declaration of function
‘CollapseWindow’
make: *** Error 1
make: *** Error 2

Thanks!

jamalta wrote on Friday, July 09, 2010:

So I just force it to compile as 32-bit and it seemed to work. To do this, I
added the flag -m32 to CFLAGS, CFLAGS_SPEED, and DYLIBFLAGS in
lib/macosx/Makefile.macosx.gcc, and the same flag to CLFAGS in the
examples/Makefile.macosx.gcc.

elmindreda wrote on Sunday, July 11, 2010:

Thank you for reporting this, but this fix is already in trunk. There is also
a new Cocoa port that should work much better on modern Mac OS X.

jamalta wrote on Tuesday, July 13, 2010:

Hi!

Thanks for your response. I was using trunk from SVN to compile when I had
this issue. Is there an update I need to instal for Cocoa? I am running Mac OS
X 10.6.4.

Thanks again!

elmindreda wrote on Tuesday, July 13, 2010:

You must be using a very old version, then, because there’s no lib/macosx
directory anymore and no macosx-gcc target. You should update to the latest
version.

jamalta wrote on Tuesday, July 13, 2010:

You’re right! I just realized I had checked out /tags/2.6. Using the /trunk
worked like a charm. Thanks so much!