Public Group

# How to use a DLL in VC 6.0?

This topic is 3706 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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

##### Share on other sites
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)?

##### Share on other sites
Quote:
 Original post by jbadamsBut, 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".

##### Share on other sites
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.

1. 1
2. 2
3. 3
frob
15
4. 4
5. 5

• 20
• 12
• 13
• 14
• 80
• ### Forum Statistics

• Total Topics
632144
• Total Posts
3004413

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!