I am learning C using gcc on fedora 16. I have several questions about libraries.
third party libraries (outside the OS and compiler) are OS-specific or compiler-specific or programming language-specific?
is there a universal procedure to install/add libraries into compiler?
what exactly libraries contain? raw source code that is meant to be compiled or machine codes?
That's all possible. Some are OS[-family] specific (like unistd.h
on POSIX systems), some are compiler specific (no specific example comes to mind), some are language specific (e.g. boost is specific to C++)
No, unfortunately. Though on posix systems it is very standardized upon folder structures.
That depends on the definition of "library". There are header-only libraries, there are libraries that you can use by integrating the source files into your build process (e.g. sqlite comes with a single source file, called "the amalgamination"), some come in binary form. There are also libraries which are loaded at runtime (shared objects on POSIX, Dynamically Linked Libraries on windows).
Static libraries may contain binary code (which is not necessarily executable-as-is code), and usually indices of available functions/classes which tell where to find what in the library.
Dynamic libraries usually contain position independent code, which is, apart from having relative addresses internally, executable.
The sky is the limit.