Tuesday, July 28, 2009

What is another name for a library file in 'C'?

Never heard of any other name. However, I do know that they have been called "static" library files because of their unchanging nature in the past. Now, most software uses DLL files, or Dynamic-Linked Libraries (Microsoft seems to love them...) to take care of various parts and pieces of code.

What is another name for a library file in 'C'?
header file would be another option. library is probably universal name for that particular name in c. but awesome question. i'll have to ask my teacher this question.
Reply:I don't think there is a synonym for a c library file. Never heard it called something else. It's been confused with header and object files by newbs, in error...





But still, you might find what you're looking for at the link below..
Reply:Library files, those containing object modules generated from C source or other compiled source, are also known as archive files. The term archive originates from early versions of UNIX, and is still the commonly used term to reference them by UNIX programmers today.





The archive command (ar) is used to manage archive files which are usually named libXXX.a where XXX is the nature of the library. Common archives are:


libc.a -- standard C library


libm.a -- standared Math library


libsocket.a -- socket





If an archive is referenced on the compile command line, the needed object modules from the archive is statically linked into the resulting binary (executable in MSDOS speak). If shared object archives are referenced at the time a binary is created, the references are noted in the binary, but not stored in the binary file itself. This results in the binary being a smaller file, but also requires that the shared object archive(s) be present on the computer where the binary is to be loaded and executed.





Shared object archvies have a name that has the form libXXX.so.v where XXX is the same type name that libXXX.a has, and v is the version number. Version numbering is important with shared objects as a binary created to work with libiconv.so.2 might not work with libiconv.so.3.





Shared object archives are sometimes referred to as dynamically linked libraries as the final 'connection' or link between the binary and the contents of the archive is done as the binary is loaded for execution. Some operating systems also allow the modules from a shared library to reside in one spot in memory and to be shared by any currently running programme that needs the functionality provided. This has the advantage of reducing the total memory needed to support concurrent executing programmes that all reference the same archive(s).








If you are running on a UNIX machine, execute man for ld, ar, and ldd to see more information about creating archives, linking, and determining the reference(s) of a binary to shared objects.


No comments:

Post a Comment