?
Solved

Writing a simple DLL

Posted on 2002-05-14
5
Medium Priority
?
202 Views
Last Modified: 2011-04-14
Hello,

  I am trying to write a simple DLL. For that I go into my Visual C++ 6.0 enviournment. I open a new project as "Win32 Dynamic-Link Library". I add my source and header files to it. I can compile & link fine. I also get my dll file in the Debug directory. Now the problem is, there is no lib file in the Debug directory. I need the lib file for my application to run. How do I get the project to make the lib file? Thanks.
0
Comment
Question by:dbdoshi
[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
  • 2
5 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 7008795
Are you sure?  The default for a DLL project is to produce an IMPORT LIB file in the same folder as the resultant DLL.  Perhaps your EXPLORER is hiding .lib file??

Try looking with a CMD/COMMAND window and use DIR /A *.lib.
0
 
LVL 86

Accepted Solution

by:
jkr earned 400 total points
ID: 7008813
You have to export a symbol in order to get a lib file.

Just add

extern "C" __declspec ( dllexport) Test () {}

and you will get one.
0
 

Author Comment

by:dbdoshi
ID: 7008814
nope, no lib file.
0
 
LVL 32

Expert Comment

by:jhance
ID: 7008820
jkr,

Good point!!  

I guess I (perhaps mistakenly) assumed that the DLL had EXPORTS.  But you are right, no exports, no lib, no useful DLL either.
0
 

Author Comment

by:dbdoshi
ID: 7008838
YES, I got it after exporting the variables and functions. Thanks.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.
Suggested Courses

771 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