Link to home
Start Free TrialLog in
Avatar of shoaib_adil
shoaib_adil

asked on

tell me

diff between library & header files?
ASKER CERTIFIED SOLUTION
Avatar of MadYugoslav
MadYugoslav
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of djbusychild
djbusychild

header files are included when you compile your code
library files are binary data that gets linked after your code is compiled.

often times an API or an SDK will release a compiled
library and an accompanying header file. This way you can refer to functions that have their prototypes defined in the header file.
Avatar of Axter
While everyone can agree what header files are, the same can?t be said for library files.

In general, library files include header files.

In other words, header files have your declarations, and library files includes implementation and declaration.
The implementation can be precompiled code, fully compiled code, or code that has not been compiled.
Example of precompiled code would be *.lib, *.obj, *.o, and *.a files.
Example of compiled code would be (Win)*.DLL and (Unix)*.so files.

No matter what type of implementation code you?re using, you always need to use their associated header files in order to use the implementation code.

So the entire package is the library, and the header files are just one part of the library.

There are some exceptions to the above.  For example, you can have your implementation code in the header file.  In which case the header files would be the library as well as the header.
Library is the collection of many headerfiles and many other useful files and information that you can call and include in your program.
header files are the files created that you may call in your programm to do specific operations although they are not required to call anymore you can do without header files.
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. Unless there is objection or further activity,  I will suggest to accept "MadYugoslav" comment(s) as an answer.

If you think your question was not answered at all, you can post a request in Community support (please include this link) to refund your points.
The link to the Community Support area is: https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Per recommendation comment force/accepted by

Netminder
Community Support Moderator
Experts Exchange