Sign in to follow this  
Shashwat Rohilla

Difference Library and API

Recommended Posts

Serapth    6671
[quote name='Shashwat Rohilla' timestamp='1310407347' post='4833874']
What is the difference between a Library and an API?
I read somewhere on the net that they can be used interchageably.

Please clear me with this..
[/quote]


A library is a group of compiled code ( functions, data ) organized into a single file. Generally with the extension .so, .a, .dll, .lib, etc.


An API ( Application Programming Interface ), is a group of methods, data, etc... that are exposed to programmers. The programming interface if you will. An API ( such as the Windows API ) can consist of many hundred libraries. Keep in mind, this isn't necisarrily a requirement to be an API, as an API could be exposed as a web service, or though other means.



And no, they are different things, although as in the above example, one can contain the other.

Share this post


Link to post
Share on other sites
frob    44902
[quote name='Shashwat Rohilla' timestamp='1310407347' post='4833874']
What is the difference between a Library and an API?
I read somewhere on the net that they can be used interchageably.

Please clear me with this..
[/quote]


Library = collection of code. A library can range from a single pre-compiled file to a large collection of items.
API = Application Programming Interface. It generally means a library of code that acts as an interface to a system, such as the interface to your OS.
SDK = Software Development Kit. Generally refers to a collection of tools, software, documentation, and code that are used together.

Share this post


Link to post
Share on other sites
jbadams    25674
Adding to the above however, they do get used interchangeably often enough that you can't always rely on the "correct" term having been chosen in any particular case, and in some cases it can be difficult to pick which (if either) of the terms would be more appropriate. The above definitions are good and fairly widely accepted though.

Share this post


Link to post
Share on other sites
[i]So an API is a set of libraries meant for a common purpose.
[/i]
For example, OpenGL contains a set of libraries to do graphics programming.
Windows API is a set of libraries to perform operations on form applications.

Am I right?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this