- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between Static and Shared libraries
In programming context library is something which has some sort of that code which is pre compiled and could get reused in any program for some specific functionality or feature.
Now on the basis of execution and storage of this code library is classified in two types i.e Static library and Shared library.
Following are the important differences between Static library and Shared library.
Sr. No. | Key | Static library | Shared library |
---|---|---|---|
1 | Definition | Static library is the library in which all the code to execute the file is in one executable file and this file get copied into a target application by a compiler, linker, or binder, producing an object file and a stand-alone executable. | On other hand Shared library is the library in which only the address of library is mentioned in the target program while all the functions and code of library are in a special place in memory space, and every program can access them, without having multiple copies of them. |
2 | Import | As mentioned in above point static library are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder. | Shared libraries are get import at the time of execution of target program by the Operating system itself. |
3 | Size | Static libraries are large in size as because external programs are built in the executable file. | On other Shared libraries are much smaller as because there is only one copy of dynamic library that is kept in memory at the time of execution only otherwise its location is remote. |
4 | Compilation | For static libraries recompilation is required if any changes were applied to external files. | On other hand for Shared libraries there is no need to recompile the executable. |
5 | Performance | Static libraries take longer to execute, because loading into the memory happens every time while executing. | While Shared libraries are faster because shared library code is already in the memory. |
6 | Compatibility | In Static library no compatibility issue has been observed. | On other hand in case of Shared library has compatibility issue as target program will not work if library gets removed from the system . |
- Related Articles
- Difference between Static and Dynamic Testing
- Difference Between Static and Dynamic Binding
- Difference between Static and Dynamic Hashing
- Difference between Static Routing and Dynamic Routing
- Difference between Static SQL and Dynamic SQL
- Difference between Static and Dynamic Web Pages
- Difference Between Static and Final in Java
- Difference between Static Electricity and Current Electricity
- Difference Between Static and Const in JavaScript
- Difference between Static Relays and Electromagnetic Relays
- How to show all shared libraries used by executables in Linux?
- Difference between Shared Memory Multiprocessors and Message-Passing Multiprocessors in Computer Architecture.
- Difference between Static binding and dynamic binding in Java
- What is the difference between static and dynamic polymorphism?
- Difference between Static Constructor and Instance Constructor in C#

Advertisements