Shared library for Linux/BSD etc?

xprog wrote on Friday, November 26, 2004:

Is there a shared library/object for *nix platforms like the .dll for windows, people need this to use GLFW with CrossPlatform non C compilers like Free Pascal.

marcus256 wrote on Monday, November 29, 2004:

No, there isn’t. There should be, of course, but I simply haven’t gotten to that point yet. Sorry.

xprog wrote on Wednesday, December 01, 2004:

I will try to use the C libs in FPC, i might just work.
Many people would like this library on *nix

epsilondelta wrote on Thursday, February 17, 2005:

I have succeeded in building a shared library on Gentoo Linux Kernel 2.6.

I’ve modified the Makefile.x11 appropriately for this task. Perhaps the update can be added to the project? The shared library has been tested with the triangle example, and it works great.

The only problem is that in order to get the library built in shared format, I had to disable the assembler section in the cpu detection source. Register EAX is being used there; unfortunately the compiler needs that register for the -fPIC option (Position Independent Code, necessary for shared libraries).

- John R.

geoman59 wrote on Wednesday, February 23, 2005:

I’m not a ASM guru myself… but the code should be able to be modified to use another register. I’m surprised the compiler couldn’t handle that by adding push and pop statements where nessecary.

I agree that a shared library could be really useful, as I also plan to use GLFW in linux with freepascal.

epsilondelta wrote on Friday, February 25, 2005:

Absolutely. It should be possible to update the assembler source to allow for the shared library build. But I didn’t want to “mess” with the stable build to get it working as long as I could just disable the macro definiton in the mean time. A push/pop likely would work, but it’s probably just better to use a different register. I didn’t look into it in much detail.

As it is now, it’s working fine without the assembler portion compiled in. I’ve compiled several fairly detailed opengl projects with the glfw shared library, and they are working great right now. I’m using a special D language interface included in the Derelict project at dsource.org.

- John R.