Compilation problem on macosx

eul_cholet wrote on Saturday, September 12, 2009:

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?

elmindreda wrote on Saturday, September 12, 2009:

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.

swiftcoder wrote on Sunday, September 13, 2009:

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.

eul_cholet wrote on Sunday, September 13, 2009:

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

elmindreda wrote on Monday, September 14, 2009:

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