Advertisement

Dynamic Libraries In *nix

Started by July 24, 2004 03:55 AM
6 comments, last by SpreeTree 20 years, 1 month ago
I have just been reading this article [link]http://www.gamedev.net/reference/articles/article928.asp[/link] about using dynamic linking with .dll's in Windows. Is this methods also possible on *nix platforms too (Granted not with dll's, but with a platform specific library)? I'm assuming that all platforms have some method of dynamically linking to libraries at runtime, but I'm only aware of a method in Windows Thanks for any help Spree
Dynamic libraries on *nix systems are usually referred to as shared objects and have the .so extension. You can look up the man pages for dlopen(), dlsym() and dlclose() for more information.
Advertisement
And take a look at the pages for ld and ldd too.
http://www.cis.gsu.edu/~shong/oojokes/
Depending on the type of Unix, you might need to use "chatr" or "dump -H" instead of "ldd".
On AIX extension of a shared library can be anything, for example: .bob, .my_shared_library, .dll, whatever you want.
On HP-UX, it will be ".sl", not ".so".
".so" on Solaris, not sure about Linux, probably also.

Definatelly on all Unixes there are shared (or in windows terms 'dynamic') libraries.

http://www.mildspring.com - developing android games

Quote: Original post by abeylin
On AIX extension of a shared library can be anything

Heh, that's not exactly AIX specific. File extensions are pretty much always arbitrary on UNIX.

And, yes, all modern unices should supports shared libraries. But there's still lots of old systems around that don't (my ultrix machine for example..).
If you're not shy of GPL, you could check out GNU Libtool. It could benefit you if you're trying to write cross platform programs using shared libraries.

If you need to avoid GPL, dlopen, etc., as mentioned by SiCrane are the way to go on unix.
-bodisiw
Advertisement
Quote: Original post by NoahAdler
If you're not shy of GPL, you could check out GNU Libtool. It could benefit you if you're trying to write cross platform programs using shared libraries.

If you need to avoid GPL, dlopen, etc., as mentioned by SiCrane are the way to go on unix.

If you're talking about libltdl (the library that wraps the native dynamic library functions), which is kind-of part of libtool, it's licensed under the LGPL, not the GPL.
Excellent, I think there is enough there for me to give it a good crack

Thanks for the help, hopefully it will be simpel enough to get working :)

Thanks
Spree

This topic is closed to new replies.

Advertisement