Click here to Skip to main content
15,906,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using ICU binary as an external binary.I have lib/dll and an include folder having some ".h" files.
Why there is include folder with libraries in open source libraries?
Posted

Not totally clear what you mean, but my guess is that you mix-up some things. The dll is used to include in your project and is already compiled so the compiler won't need to do this over and over again. The .h files contain certain datatypes used in the library dll. The dll might expect some kind of struct type as input for some functions. The header files contain those specific types so you don't need to figure them out and redefine yourself.
In some crude way you can look at header files as some kind of spoiler alert for the compiler that tells it what to expect in the code files. It also gives you information about defined types and function.

Ps. also libraries that aren't open source can include the header files. They don't contain the actual implementation (or at least shouldn't) but do make the library usable.

Good luck!
 
Share this answer
 
v2
Comments
ahsanriaz1K 23-May-12 5:10am    
thanks ....
There should be an include folder (or, at least, an include file) in all libraries, since the library client program (that is your application) needs at least the prototypes of the library exported functions.
 
Share this answer
 
v2
Comments
ahsanriaz1K 23-May-12 5:08am    
You wrote "needs at least the prototypes of the library exported functions" but why? Can you please tell me?
CPallini 23-May-12 5:30am    
How can you (actually the compiler) tell you're correctly calling a function without knowing its prototype?
Why there is include folder with libraries in open source libraries?
If I understand your question, it asks why do we have few *.h files in a folder.

This is because, this folder will have all the libraries that the open source is referring/using at some point. Keeping it separate in a folder makes it easy to find the external dependent libraries from maintenance point too. Separate folder signifies the folder as referenced library folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900