?
Solved

dll and lib files

Posted on 2002-04-22
3
Medium Priority
?
318 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
[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
 
LVL 86

Accepted Solution

by:
jkr earned 200 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses
Course of the Month14 days, 14 hours left to enroll

770 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