By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,318 Members | 2,107 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,318 IT Pros & Developers. It's quick & easy.

Static and dynamic library

P: n/a
can anyone tell me what the static and dynamic library?

thnkx in advance.

Dec 26 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
meendar wrote:
can anyone tell me what the static and dynamic library?

thnkx in advance.


This isn't really a C++ question and so isn't on-topic in this group,
but it's Christmas.

A static library is linked into the program itself. A dynamic library is
external, and loaded by the program when needed.
Dec 26 '05 #2

P: n/a
thanks for your help.
but in an interview i was asked, how can we use static and dynamic
library in c++?

Dec 26 '05 #3

P: n/a
meendar wrote:
thanks for your help.
but in an interview i was asked, how can we use static and dynamic
library in c++?


It's an issue that occurs often when using C++ to create applications,
but it's not an actual C++ language question. You may well be expected
to know how use both static and dynamic libraries at work, but it's not
relevant in this group.
Dec 26 '05 #4

P: n/a
"meendar" <as****************@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
thanks for your help.
but in an interview i was asked, how can we use static and dynamic
library in c++?


Try microsoft.public.vc.language for this question (even if you don't use
vc). They will be able to answer your Windows specific c++ questions.
Dec 26 '05 #5

P: n/a
meendar wrote:
thanks for your help.
but in an interview i was asked, how can we use static and dynamic
library in c++?

It would depend on the particular environment. I've built shared files
on a Sun before, where you need to use a particular flag when compiling
the object files, and another when linking them to make a library.

The main advantage with static libraries is that if the executable
program is is moved to another machine, it will not depend on the
library being installed, there. However, it has disadvantages too - the
program is bigger, takes up more memory if invoked several times and
updates to the library will not be reflected in the executable.

Overall, static libraries seem to be dying. Solaris 10 no longer ships
with static libraries.

You need to look at the particular documentation on your own C++
compiler and linker.

Sorry, must stop there, as otherwise I will get shot on what must be the
most unfriendly newsgroup I have ever come across.

--
Dave K

http://www.southminster-branch-line.org.uk/

Please note my email address changes periodically to avoid spam.
It is always of the form: month-year@domain. Hitting reply will work
for a couple of months only. Later set it manually. The month is
always written in 3 letters (e.g. Jan, not January etc)
Dec 26 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.