Re: Implicit Linking to a DLL
On Tue, 6 May 2008 13:40:33 -0700 (PDT), ninjasan8 <m.ninja.s@gmail.com>
wrote:
I'm working on a project that requires me to include curses.h (a
graphics thing), but I can't figure out how to do this. I'm using VC++
2008 Express Edition, but all the help about implicit linking seems to
be aimed towards the 2005 version (I think, I can't really find the
sections they're referring to).
I have a pdcurses.lib, pdcurses.dll and two .h files. I put the .h
files in the include folder, but I don't know what I should do with
the other files to link them to my project. Any help is appreciated.
1. Create a dedicated directory for library files like this.
2. Add this directory to "Executable Files" and "Library Files" in the
"VC++ Directories" section of the IDE options dialog box.
3. Move the .lib and .dll files to this directory.
4. Add the .lib file to your project's additional libraries using the
linker options dialog box.
You could also do the corresponding thing with the header file, so that you
don't have to incorporate it into every project that uses it.
This will allow you to run the program from the IDE. More generally, you
could do the same thing with the PATH environment variable. For deployment
purposes, you will have to distribute the DLL with your program; they both
can live in the same directory, and you won't have to worry about these
path issues.
--
Doug Harrison
Visual C++ MVP