Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Writing a simple DLL

Posted on 2002-05-14
5
Medium Priority
?
204 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 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

810 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