PDA

View Full Version : Dynamic Libraries and definition files



IconTree
08-10-2005, 02:34 AM
When programming on Windows, and working with dll's, I always include the corresponding .lib file so that I do not have to deal with actually dynamically loading the library, jut still have the ability to change the dll.

Is there something similar possible in Linux when working with .so files? I understand there is a .la file, but I am unsure of where this fits in with the whole process.

Or, am i going to have to dynamically load all my libraries on Linux?

Thanks
IconTree

jim mcnamara
08-10-2005, 01:51 PM
In terms of system impact, it's usually better to use shared libraries - they use less memory.
You can link them statically -
assume you created mylib.a with lots of object modules, plus you want to link C runtime statically as well. Simple example:


gcc mycode.c -o mycode mylib.a /usr/lib/libc.a