tell me

Posted on 2001-06-13
Last Modified: 2010-04-02
diff between library & header files?
Question by:shoaib_adil
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

MadYugoslav earned 50 total points
ID: 6189705
Header files are source files with declarations of identifiers.
Library files are files with implementation (definition) of previously declared identifiers.
Identifiers are types (classes with attributes and methods), variables and functions.

Expert Comment

ID: 6189771
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.
LVL 30

Expert Comment

ID: 6190476
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.
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 6196866
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.
LVL 11

Expert Comment

ID: 6817343
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:


Expert Comment

ID: 6833295
Per recommendation comment force/accepted by

Community Support Moderator
Experts Exchange

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C++ Language error 28 305
How to convert MFC APP to Win32 APP. 19 130
Exception thrown at 0x00007FFD5BC81F28 7 60
Error creating a new C++ project in ,net 20 55
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question