I have a static library file (.a file), which I linked in my program. I included the header file for using the library. As far as i know if i link a library i dont need the implementations, because they are all compiled in the library file. But the header file of the library includes the some othe开发者_JAVA百科r header files. Should i need the c files for the function definitions declared in 'other' header files?
If the source has been compiled into the library, no. If the source for these headers has been compiled into some other library, you will need to link against that library. Otherwise, yes.
What does the documentation for the library say? Some libraries do
require others: these have to be installed, and you have to add the
appropriate -I
, -L
and -l
options when compiling and linking. But
it's quite possible that the library itself defines several headers, and
that the includes you are seeing are just for other parts of the
library. Only the library documentation can tell you which it is.
精彩评论