# Problem compiling in Mac OSX 10.6

**URL:** <https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307>\
**Category:** support\
**Created:** [July 9, 2010, 7:52pm UTC](https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307 "2010-07-09T19:52:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 9, 2010, 7:52pm UTC](https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307/1 "2010-07-09T19:52:50Z")

</div>

**[jamalta](https://sourceforge.net/u/jamalta/)** wrote on [Friday, July 09, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/45d2908d/#4243):

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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 9, 2010, 8:24pm UTC](https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307/2 "2010-07-09T20:24:41Z")

</div>

**[jamalta](https://sourceforge.net/u/jamalta/)** wrote on [Friday, July 09, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/45d2908d/#0c57):

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 11, 2010, 9:44pm UTC](https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307/3 "2010-07-11T21:44:27Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, July 11, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/45d2908d/#28a5):

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 13, 2010, 12:10am UTC](https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307/4 "2010-07-13T00:10:14Z")

</div>

**[jamalta](https://sourceforge.net/u/jamalta/)** wrote on [Tuesday, July 13, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/45d2908d/#048e):

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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 13, 2010, 12:21am UTC](https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307/5 "2010-07-13T00:21:26Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, July 13, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/45d2908d/#bfa9):

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [July 13, 2010, 6:10am UTC](https://discourse.glfw.org/t/problem-compiling-in-mac-osx-10-6/307/6 "2010-07-13T06:10:54Z")

</div>

**[jamalta](https://sourceforge.net/u/jamalta/)** wrote on [Tuesday, July 13, 2010](https://sourceforge.net/p/glfw/discussion/247562/thread/45d2908d/#75f4):

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