M
moschops
I'm not even sure this is the right group to ask about static libraries.
If not, please accept my apologies.
Anyway, static libraries. I often build them, for the usual reasons, and
each time I do I end up with a header file to include in any program
that will be using the functions provided by the static lib, and the
static lib itself.
When I build the static lib, I must specify the functions I wish to be
available (exported) - accordingly, even if the static library is
chock-full of sub-functions and the like, if I export only one function,
the program using the static lib may call only on that one function.
Attempts to use any other function will be met with the usual undefined
symbol error messages during linking, which is great for ensuring people
use the library only as intended (analogous to a class' private and
public functions), and of course the function that can be called has
full access to all the other functions within the library as expected.
How does a static library indicate which functions may be called from
it? It must do it somehow, as it's a single file. Is there a listing
somewhere in there that can be read by my linker?
'Chops
If not, please accept my apologies.
Anyway, static libraries. I often build them, for the usual reasons, and
each time I do I end up with a header file to include in any program
that will be using the functions provided by the static lib, and the
static lib itself.
When I build the static lib, I must specify the functions I wish to be
available (exported) - accordingly, even if the static library is
chock-full of sub-functions and the like, if I export only one function,
the program using the static lib may call only on that one function.
Attempts to use any other function will be met with the usual undefined
symbol error messages during linking, which is great for ensuring people
use the library only as intended (analogous to a class' private and
public functions), and of course the function that can be called has
full access to all the other functions within the library as expected.
How does a static library indicate which functions may be called from
it? It must do it somehow, as it's a single file. Is there a listing
somewhere in there that can be read by my linker?
'Chops