You are here:

C/Re; Building libraries

Advertisement


Question
Regarding building libraries I was talking about msdos based libraries where the library code is statically linked. Since the compiler knows which function the execuatble is going to call it can link only the needed function.

Answer
First of all, it is not the function that gets linked. It is the library that gets linked.
And that function in the library may call another function of the same library. So, if compiler starts checking each function for all these dependencies, it will take very long time for it to compile!

Another important thing is, for a compiler the library is a "Black Box". It will look at it as a single big box (not as a small boxes with different functions) and use it that way.
So, whether it is static or dynamic library, the whole library will be loaded, not individual functions.

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.