How to use a DLL in VC 6.0?

Started by
2 comments, last by Punchin Deck 15 years, 10 months ago
I used the #import "dllname.dll" at the top of my cpp file but when I try to compile it, it says that it cannot find the library for it, while the lib file is in my project directory. How do I show Visual Studio 6.0 how to find the library file for that dll. -Thnx
Advertisement
Firstly, Visual Studio 6 is horribly out of date. It predates standardisation of C++ and therefor offers pretty poor support for proper modern usage of the language. You can get the 2008 Express Editions (which are the latest version of VS) for free from Microsoft. I can't recommend updating your tools strongly enough.


But, to take a shot at answering your question, have you added the library in question to your additional dependencies (I can't recall how that's done in VS6, but now that you've got the term you should be able to google for it)?

- Jason Astle-Adams

Quote:Original post by jbadams
But, to take a shot at answering your question, have you added the library in question to your additional dependencies (I can't recall how that's done in VS6, but now that you've got the term you should be able to google for it)?

In addition to what you already said, this is yet another reason to upgrade. Virtually no one else uses VC6.0, so pretty much anything you ask will be answered with "I can't remember how it worked in VC6.0".
Ummm... I normally use:
#pragma comment(lib, "dllname")

Make sure that the dll is in the same directory as the program exe too. Failing that, just copy the dll into your windows\system32 directory and see if it picks it up there.


This topic is closed to new replies.

Advertisement