Writing a simple DLL

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.
dbdoshiAsked:
Who is Participating?
 
jkrCommented:
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
 
jhanceCommented:
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
 
dbdoshiAuthor Commented:
nope, no lib file.
0
 
jhanceCommented:
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
 
dbdoshiAuthor Commented:
YES, I got it after exporting the variables and functions. Thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.