hi,

what is the difference between static and shared library how do we create them and what is the extension used for both of

Recommended Answers

All 3 Replies

Every different program that uses a static library has its own copy of the library built in. A shared library only has one copy and every program that uses it just references that copy. How you create them depends on the tool you're using, and how they're named depends on the platform. For example, on Windows it might be *.lib versus *.dll. On Linux it might be *.a versus *.so.

And it gets a little more complicated because there are *nix compilers that have been ported to MS-Windows os, and consequently still use *.a library extensions. Dev-C++ is one such compiler. So for libraries the extension depends on the compiler.

Not that it matters too much. I think that .lib files are the same format as .a files these days.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.