Solved

Writing a simple DLL

Posted on 2002-05-14
5
201 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 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
  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 …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

717 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