i am porting a program to Linux from OS/2 that loads DLLs on the fly.
the DLLs are defined as having standard functions ('Init()',
'Process()',
'Terminate()' for example) which the executable queries the address of
through a function call. under OS/2 i have created a static library
that
contains the standard functions (so that the programmer is not concerned
with so system specific stuff), which then call the programmers code.
under OS/2 this model works fine (compile the programmer code, link the
output object file with a standard static library that defines the
standard functions to produce a DLL). under UNIX i get a DLL generated
but the standard functions are missing.
am i correct in assuming that 'gcc' will only link library files and
object files provided that at least one function in the library file
is called by an object file? if this is true how can i get the DLL to
be linked proper as the standard library calls the object file (and not
the other way round)? if i'm wrong what is wrong with this line in my
Makefile:
gcc -shared -Wl,-soname,library.so.1 -o library.so.1.0 library.o
standard.a
i would appreciate an answer if someone has one. cheers.
========================================================================
========================================================================