Jump to content
  • Advertisement
Sign in to follow this  
Flopid

How to use a DLL in VC 6.0?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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)?

Share this post


Link to post
Share on other sites
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".

Share this post


Link to post
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.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

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!