-
June 21st, 2013, 10:16 PM
#1
.dlls in visual studio c++
When you are using a generic library that comes with .libs, .h headers, and .dll's, you configure a new project and point VC++ to look at the directories configured in the project properties. But where in the project properties do you add a pointer to the dll's? Right now I have to modify the system PATH variable or copy the DLLs into the build directory.
In other words, how do I point VC++ to the DLLs when I start debugging because unless the DLLs are in the build directory, launching a debug session will cause a crash saying the DLL cannot be found.
-
June 21st, 2013, 11:12 PM
#2
Re: .dlls in visual studio c++
Originally Posted by bigc++
When you are using a generic library that comes with .libs, .h headers, and .dll's, you configure a new project and point VC++ to look at the directories configured in the project properties. But where in the project properties do you add a pointer to the dll's?
DLL's are not involved in the build process. A DLL file only comes into play when you run your program, so there is no such thing as "pointing to a DLL" in Visual Studio.
how do I point VC++ to the DLLs when I start debugging
Again, there is no such thing as "pointing to a DLL". It is the responsibility of the OS to find and load the DLL, and there are rules as to how the OS searches for DLLs.
Regards,
Paul McKenzie
-
June 23rd, 2013, 01:51 PM
#3
Re: .dlls in visual studio c++
-
June 24th, 2013, 07:24 AM
#4
Re: .dlls in visual studio c++
either have all the projects in a single solution and have all projects output to the same directory (the default for new projects in VS)
or have a custom build step in the .dll project to copy the dll to the output dir of the exe hosting the dll each time it's built... or to a directory already in the PATH.
or have a custom build step in the .exe project to copy the dll to the output dir of the exe hosting the dll each time it's changed.
or change the DLL loading code to use a full path (if using LoadLibrary)
or change the PATH to add the dll output dir.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|