Solved

Writing a simple DLL

Posted on 2002-05-14
5
195 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
  • 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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 how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
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.

705 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

15 Experts available now in Live!

Get 1:1 Help Now