Solved

dll and lib files

Posted on 2002-04-22
3
310 Views
Last Modified: 2010-04-02
I'm currently playing with creating dll's in visual c++.
Everything's working great. I just a a small question.
When you compile the project, two files are created:
lib and dll. Am I correct in assuming that the dll is the
actual executable code, and that the lib file is like a
kind of descriptive file that explains to the program whats in the dll?

-Chris
0
Comment
Question by:CPOsosky
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 50 total points
ID: 6960750
You are absolutely right - the lib file (also called "import lib") only satisfies the linkers need to resolve all symbol names; it merely is an "import table" that points to the DLL itself.
0
 
LVL 86

Expert Comment

by:jkr
ID: 6960758
BTW: Here's the description from the VC++ glossary:

"import library
A .LIB file that contains information about one or more dynamic-link libraries (DLLs), but does not contain the DLL's executable code. The linker uses an import library when building an executable module of a process, to provide the information needed to resolve the external references to DLL functions. "
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6961179
>>and that the lib file is like a kind of descriptive file that explains to the program whats in the dll?

You might have a misconception.  The LIB file is used only by the LINKER.  Later, when a program accesses the DLL, the LIB file is not needed.  So it doesn't 'explain to the program...', rather, it 'explains to the LINKER...'.

-- Dan
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now