# Problems compiling in MacOSX 10.6

**URL:** <https://discourse.glfw.org/t/problems-compiling-in-macosx-10-6/506>\
**Category:** support\
**Created:** [November 22, 2009, 1:19pm UTC](https://discourse.glfw.org/t/problems-compiling-in-macosx-10-6/506 "2009-11-22T13:19:13Z")\
**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:** [November 22, 2009, 1:19pm UTC](https://discourse.glfw.org/t/problems-compiling-in-macosx-10-6/506/1 "2009-11-22T13:19:13Z")

</div>

**[artblanc](https://sourceforge.net/u/artblanc/)** wrote on [Sunday, November 22, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2da136eb/#9814):

I’m getting a problem compiling the current trunk version (2.7-pre) under  
MacOSX 10.6 (Snow Leopard).

Well, actually is not the library, is it’s linkage with the other apps.

I had to add a -arch i386 to the makefiles.

I was getting a:  
ld: warning: in …/lib/cocoa/libglfw.a, file is not of required architecture

---

<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:** [November 22, 2009, 4:51pm UTC](https://discourse.glfw.org/t/problems-compiling-in-macosx-10-6/506/2 "2009-11-22T16:51:11Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, November 22, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2da136eb/#90ea):

Am I correct in assuming then that the Snow Leopard compiler(s) default to  
generating 64-bit code even on 32-bit systems?

---

<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:** [November 22, 2009, 7:56pm UTC](https://discourse.glfw.org/t/problems-compiling-in-macosx-10-6/506/3 "2009-11-22T19:56:25Z")

</div>

**[artblanc](https://sourceforge.net/u/artblanc/)** wrote on [Sunday, November 22, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2da136eb/#c0e7):

The thing is that I needed to add a -arch i386 in the Makefile.cocoa of the  
trunk/lib/cocoa and in the Makefile.cocoa of trunk/examples.

But now I realize that the compilation didn’t finished because the  
Makefile.cocoa in /trunk/tests has a flag:

CFLAGS = -I…/include -m32

that was asking for a 32 bit version.

If I remove this -m32 everything is compiling and I don’t need to add the  
-arch i386 to build the trunk (lib + examples + tests).

About which is the default architecture by default… I’m a little bit confused  
about this.  
If I try to link the default compiled library (not adding de -arch i386)  
with my App I still have some architecture problems.

If I want to produce a 32 bits app I get another  
ld: warning: in …/lib/cocoa/libglfw.a, file is not of required architecture

But if I configure my project to produce a 64 bits app I get a linker error:

“\_objc\_msgSendSuper2”, referenced from:  
- in libglfw.a(cocoa\_window.o)  
ld: symbol(s) not found  
collect2: ld returned 1 exit status

The only way I could link the library with my App with success was adding a  
-arch i386 on glfw makefiles and build my app as a 32 bit app.

So It seems you are right in some way about assuming that I’m getting a 64-bit  
code by default.

I will try to learn something more about 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:** [November 22, 2009, 8:20pm UTC](https://discourse.glfw.org/t/problems-compiling-in-macosx-10-6/506/4 "2009-11-22T20:20:01Z")

</div>

**[artblanc](https://sourceforge.net/u/artblanc/)** wrote on [Sunday, November 22, 2009](https://sourceforge.net/p/glfw/discussion/247562/thread/2da136eb/#2f31):

The linker error I got compiling with 64 bit:

“objcmsgSendSuper2”, referenced from: - in libglfw.a(cocoa\_window.o) ld:  
symbol(s) not found collect2: ld returned 1 exit status

Disappear if I compile my app with SDK 10.6 (I was compiling with SDK 10.5).  
Now everything is compiling.

I still have to think on all the implications of this 🙂

---

<div class="post-metadata">

**Author:** ![dougbinks](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.glfw.org/dougbinks/32/39_2.png) [@dougbinks](https://discourse.glfw.org/u/dougbinks)\
**Post date:** [November 16, 2026, 4:18pm UTC](https://discourse.glfw.org/t/problems-compiling-in-macosx-10-6/506/5 "2026-11-16T16:18:27Z")

</div>

Closed on November 16, 2026, 4:18pm UTC


