# Shared library for Linux &amp; MacOSX?

**URL:** <https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415>\
**Category:** support\
**Created:** [November 29, 2006, 4:58pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415 "2006-11-29T16:58:35Z")\
**Posts on this page:** 13\
**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 29, 2006, 4:58pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/1 "2006-11-29T16:58:35Z")

</div>

**nobody** wrote on [Wednesday, November 29, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#07d1):

I’m currently using glfw.DLL on Win32 and it works very well.  
Now I’d like to port my application to Linux and MacOSX with shared library.  
Is there any way to build shared library version for Linux and MacOSX?  
Has anyone ever done this before?  
I have limited experienced in Linux/MacOSX.  
Any assistance would be much appreciated.

---

<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 29, 2006, 7:52pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/2 "2006-11-29T19:52:03Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Wednesday, November 29, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#d71a):

The upcoming 2.6 branch (which is in CVS) has support for building shared libraries on Linux and Mac OS X, but why would you want to? GLFW is very suitable for static linking and especially for Linux, static linking makes both the distribution and the running of your application much simpler.

---

<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 30, 2006, 1:11am UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/3 "2006-11-30T01:11:29Z")

</div>

**nobody** wrote on [Thursday, November 30, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#66ca):

Thanks for the fast reply.  
I’m wondering when 2.6 RC or beta would be officially announced?  
I’ll definitely check out CVS code first.

I need shared library version because I program in C#/Mono.NET and GLFW via Tao framework binding.  
It must be a dynamic/shared library to be able to use P/Invoke for C/C++ code.  
Otherwise, I have to create a stub DLL which is statically linked with GLFW and then do P/Invoke with that stub DLL.

---

<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 30, 2006, 4:59pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/4 "2006-11-30T16:59:58Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Thursday, November 30, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#66ca/1621):

I’m not sure when a beta will be out. I do know that I’m busy with lectures until the 8th of December, but am longing to get back to work on GLFW as soon as they’re done.

Note that the code is still under the BRANCH\_2\_6 branch.

Ah, I see. That’s a good reason to use it ^^

---

<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:** [December 1, 2006, 7:39am UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/5 "2006-12-01T07:39:31Z")

</div>

**nobody** wrote on [Friday, December 01, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#5419):

I signed up the dev and user mailing list to see if I could help something.  
So glad that GLFW is back and ongoing.  
Thanks for your devotion sincerely! 🙂

---

<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:** [December 1, 2006, 8:01am UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/6 "2006-12-01T08:01:53Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Friday, December 01, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#f25c):

Cool. Welcome! Note that I’ll be away for another week, though.

---

<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:** [December 3, 2006, 7:16am UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/7 "2006-12-03T07:16:19Z")

</div>

**nobody** wrote on [Sunday, December 03, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#cbf5):

I too am interested in a shared library for OS X, while I have managed to make one it doesn’t work in windowed mode. There is no focus for the window so you can’t move it arround, or give input to it, fullscreen mode works however. Here is the diff to use for the Makefile to make it a shared library:

20c20  
\< CFLAGS = -c -I. -I… -Wall -Os  
—  
\> CFLAGS = -fPIC -c -I. -I… -Wall -Os  
30,31c30,31  
\< MKLIB = ar  
\< LIBFLAGS = -rcs  
—  
\> MKLIB = gcc  
\> LIBFLAGS = -single\_module -dynamiclib -framework Carbon -framework AGL -framework OpenGL -o libglfw.dylib  
64,66c64  
\< $(MKLIB) $(LIBFLAGS) $@ $(OBJS)  
\< $(RANLIB) $@  
\<  
—  
\> $(MKLIB) $(LIBFLAGS) $(OBJS)

If you gave me some insight on why it’s not currently working in windowed mode then I would be glad to help make those changes, btw this is the cvs 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:** [December 3, 2006, 5:49pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/8 "2006-12-03T17:49:22Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, December 03, 2006](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#cbf5/9650):

That is a known problem in OS X and is not related to the way you’re linking against GLFW. OS X is not recognising it as a desktop application. You need to either put it into an application bundle or create a resource fork on it. Have a look at the GLFW examples.

---

<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:** [January 22, 2007, 11:33pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/9 "2007-01-22T23:33:57Z")

</div>

**nobody** wrote on [Monday, January 22, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#07d1/bb86):

Leaving aside the general, well-known advantages of having a shared library, one specific reason I’d like a shared library on Linux is so I can use GLFW with my favourite language/compiler, Free Pascal. Once version 2.6 of GLFW is released I plan to make available to my fellow Free Pascal users a conversion of the GLFW header. The more GLFW users, the better.

---

<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:** [January 28, 2007, 4:52pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/10 "2007-01-28T16:52:52Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, January 28, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#07d1/bb86/7c5e):

The 2.6 release builds shared libraries for all platforms. Hopefully it’ll be out soon, but for now it’s in CVS.

---

<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:** [March 29, 2007, 11:19pm UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/11 "2007-03-29T23:19:02Z")

</div>

**nobody** wrote on [Thursday, March 29, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#cbf5/9650/9568):

I have problem in porting on Mac OS X a glfw applicationt that works fine under Windows and Linux. In particular the windows appear to not process the events coming from mouse and keyboard. I don’t undertand why the example wokrs fine.

---

<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:** [March 30, 2007, 12:36am UTC](https://discourse.glfw.org/t/shared-library-for-linux-amp-macosx/415/12 "2007-03-30T00:36:03Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Friday, March 30, 2007](https://sourceforge.net/p/glfw/discussion/247562/thread/aa20c18a/#b84a):

For the Mac OS X window manager to fully recognise your application, you need to either add a resource fork to the binary with Rez(1) or preferably put it into an application bundle. You can read more about application bundles at the Apple Developer Connection. There is also a script for creating simple bundles in the examples directory of your GLFW distribution.

---

<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/shared-library-for-linux-amp-macosx/415/13 "2026-11-16T16:18:20Z")

</div>

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


