Reputation: 7155
I have tried to find how to create DLL-s on linux using google, but got very confusing information.
Is it possible to write dynamic link libraries on linux? If not, are there other means by which I can call code in another module from several running programs?
Upvotes: 2
Views: 9689
Reputation: 34853
It is a lot if you are just getting started, but at some point you will need to refer to Ulrich Drepper’s “How To Write Shared Libaries.”
Upvotes: 1
Reputation: 40382
As Sklivvz has said, the term you're after on linux is shared object. These are given the file extension .so
.
Using gcc you can create a .so
by using the -shared
option.
eg.
gcc -shared -o libfoo.so foo.c
If you name your shared object lib*.so you can compile against it by using the -l
option on your linker. Note that the "lib" is inferred in this circumstance.
ie.
ld -o a.out -lfoo someobject.o
Alternatively you can load .so
files at runtime, just as you can with .dll
s, using dlopen() and dlsym().
Upvotes: 8
Reputation: 23759
I guess .SO files instead of DLL files, meaning shared object, not StackOverflow :), is what you want.
Upvotes: -1
Reputation: 31143
That's because DLL is a Windows term. In Linux they are called shared libraries.
http://www.linux.org/docs/ldp/howto/Program-Library-HOWTO/shared-libraries.html
Upvotes: 16