# Compilation problem on macosx

**URL:** <https://discourse.glfw.org/t/compilation-problem-on-macosx/501>\
**Category:** support\
**Created:** [September 12, 2009, 2:07am UTC](https://discourse.glfw.org/t/compilation-problem-on-macosx/501 "2009-09-12T02:07:23Z")\
**Posts on this page:** 5\
**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:** [September 12, 2009, 2:07am UTC](https://discourse.glfw.org/t/compilation-problem-on-macosx/501/1 "2009-09-12T02:07:23Z")

</div>

**[eul\_cholet](https://sourceforge.net/u/eul_cholet/)** wrote on [Saturday, September 12, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/32ecbe9b/#b9df):

Hello,  
I’ve been trying to compile the project on macosx snow leopard and I get this  
error:

macosx\_window.c:374: error: ‘typeLongInteger’ undeclared (first use in this  
function)

I don’t see typeLongInteger beign declare anywhere. Also, I get alot of  
implicit declaration in this file.

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’

Does anyone knows how to fix this?

---

<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:** [September 12, 2009, 9:41am UTC](https://discourse.glfw.org/t/compilation-problem-on-macosx/501/2 "2009-09-12T09:41:29Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Saturday, September 12, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/32ecbe9b/#b6d9):

The proper solution is a port to Cocoa, which is in progress.

I may get the opportunity to test on Snow Leopard in the coming weeks. Until  
then, I can’t really say.

---

<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:** [September 13, 2009, 12:50am UTC](https://discourse.glfw.org/t/compilation-problem-on-macosx/501/3 "2009-09-13T00:50:11Z")

</div>

**[swiftcoder](https://sourceforge.net/u/swiftcoder/)** wrote on [Sunday, September 13, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/32ecbe9b/#d27c):

The problem is that GLFW on the Mac is implemented on top of Carbon, Carbon is  
not supported for 64-bit applications, and Snow Leopard’s toochain defaults to  
64-bit.

As elmindreda says, the correct solution is to wait for the Cocoa port of GLFW  
(though an estimated release date would be lovely to know).

However, that is obviously not feasible in the short term, and there is a  
workaround. As long as your application does not require 64-bit (i.e. does  
not need access to more than 4 GB of RAM), then you can compile both GLFW and  
your application in 32-bit mode, and all will work fine.

If you are compiling on the command line, you need to pass GCC the '-m32’  
option. If you are using XCode, you can set the target architecture to 'i386’  
instead.

---

<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:** [September 13, 2009, 1:41pm UTC](https://discourse.glfw.org/t/compilation-problem-on-macosx/501/4 "2009-09-13T13:41:20Z")

</div>

**[eul\_cholet](https://sourceforge.net/u/eul_cholet/)** wrote on [Sunday, September 13, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/32ecbe9b/#cfab):

Thanks a bunch, the -m32 option did the trick.

---

<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:** [September 14, 2009, 9:51pm UTC](https://discourse.glfw.org/t/compilation-problem-on-macosx/501/5 "2009-09-14T21:51:16Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Monday, September 14, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/32ecbe9b/#5e7a):

@swiftcoder: I have initial code for GLFW 2.7 on Cocoa, which I’ve been lazy  
about committing. It should appear in the lite branch shortly.
