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