Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Library

Posted on 2000-04-19
3
Medium Priority
?
340 Views
Last Modified: 2013-11-08
When we create dll we end up with .lib , .dll files ,similarly the c/c++ runtime library has got .lib files( example: of their declaration is in stdio.h,iostream.h) then what is the difference between these two .lib files ?
0
Comment
Question by:r_sam_14
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:r_sam_14
ID: 2733292
Please give example to explain the difference clearly
0
 

Accepted Solution

by:
mayab earned 60 total points
ID: 2733528
the following is the diffrence between them:

Static Linking
In high-level programming languages such as C, Pascal, and FORTRAN, an application's source code is compiled and
linked to various libraries to create an executable file.
These libraries contain object files of precompiled functions that are called to accomplish common tasks, such as
computing the square root of a number or allocating memory. When these library functions are linked to an
application, they become a permanent part of the application's executable file. All calls to the library functions
are resolved at link time

Dynamic Linking
Dynamic linking provides a mechanism to link applications to libraries at run time. The libraries reside in their
own executable files and are not copied into applications' executable files as with static linking.
These libraries are called dynamic-link libraries (DLLs) to emphasize that they are linked to an application when
it is loaded and executed, rather than when it is linked. When an application uses a DLL, the operating system
loads the DLL into memory, resolves references to functions in the DLL so that they can be called by the
application, and unloads the DLL when it is no longer needed. This dynamic linking mechanism can be performed
explicitly by applications or implicitly by the operating system.

Differences Between Static-Link Libraries and Windows DLLs
----------------------------------------------------------
Windows DLLs differ considerably from static-link libraries. Basic differences between the two are as follows:

Static-link libraries reside in .LIB files, which are basically collections of object files, whereas dynamic-link
libraries reside in separate executable files that are loaded by Windows into memory when they are needed.

Each application that uses a static-link library has its own copy of the library. However, Windows supports
multiple applications simultaneously using one copy of the same DLL.

Static-link libraries contain only code and data because they are stored as a collection of object files.
Windows DLLs, on the other hand, can contain code, data, and resources such as bitmaps, icons, and cursors,
because they are stored as executable program files.

Static-link libraries must use the data space of the application, whereas DLLs may (and often do) have their own
data address space mapped into the address space of the process.
0
 

Author Comment

by:r_sam_14
ID: 2735192
Thank you mayab

can you explain why stdio.h/iostream.h are packaged as static library and afxwin.h is packaged as dll.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question