Linking to DLLs with Visual Studio 10
Hello,
I have a library that I want to link to with Visual Studio 10. It is a dynamic-link library, with a .dll file and a .lib file. I am following what I think is the correct procedure for linking, but it is not working. Here is what I have tried:
1. Add the directory of the .lib file to "Additional Library Directories".
2. Add the .lib to "Additional Dependencies".
3. Add the directory of the .dll file to "VC++ Directories / Executable Directories".
Running this program tells me that it cannot find the required .dll file.
The only way I can solve this is by manually copying the .dll file into the Debug or Release folder of my Visual Studio project. But isn't this the same as step 3 from above?
Thanks for your help.
Re: Linking to DLLs with Visual Studio 10
What I've always done is modify my PATH environment variable to include the path to the dll in Control Panels -> System -> Advanced. Either modify or create a user PATH variable, there's no need to edit the admin version.
You will need to close and reopen Visual Studio before changes to the environment take effect.
Re: Linking to DLLs with Visual Studio 10
Another way is to add the path in the debug settings environment. It's quite handy since you don't have to add path's for every single project you work on.