Steve
Steve

Reputation: 6444

Have VS automatically copy DLL to executable output directory

I've created an (un-managed) C++ project in VS2013. I've obtained pre-built GLFW binaries for windows, which include files glfw3dll.lib and glfw3.dll, which are both currently in the same directory. I've added the library and search path to my project options and can successfully build. I can also successfully run if I copy the glfw3.dll file to the location of my executable.

How can I tell the VS build system to automatically copy this file? I tried adding it to my project and looking for something under its properties like "copy to output directory" (as exists in .NET projects), but I didn't see anything like this.

Upvotes: 1

Views: 1087

Answers (1)

Marco A.
Marco A.

Reputation: 43662

You can use VS's post-build event in order to copy necessary dependencies at the end of the build process. The TargetDir property usually specifies by default the destination directory

enter image description here

Upvotes: 1

Related Questions