meendar wrote:[color=blue]
> thanks for your help.
> but in an interview i was asked, how can we use static and dynamic
> library in c++?
>[/color]
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)