Static and dynamic library

W

W Marsh

meendar said:
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.
 
M

meendar

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

W Marsh

meendar said:
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.
 
J

Jim Langston

meendar said:
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.
 
D

Dave

meendar said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,754
Messages
2,569,525
Members
44,997
Latest member
mileyka

Latest Threads

Top