I'm using Visual Studio 2012 with C++, developing a Qt application.
I'm able to compile it and debug it, but, somehow, no .dll file is in the Debug or Release folder. I've tried some of other posts solutions, but none worked.
So, how can I make Visual Studio copy the required .dll files into the release folder?
I think it should be an option somewhere. I'm just starting to think about copying it handmade.
Use a post-build action in your project, and add the commands to copy the offending DLL. The post-build action are written as a batch script. The output directory can be referenced as $(OutDir) . The project directory is available as $(ProjDir) .
Too much bad advice, a DLL cannot be a resource. Windows demands that code is stored in a separate executable file with a proper PE32 header. Which permits it to create a memory-mapped file to map the file content into memory, allowing the code to be shared by multiple processes and keeping it out of the paging file. And to relocate the code when the DLL's base address is already in use.
Simply use Project + Properties, Build events, Post-Build Event to xcopy the DLLs. Arbitrarily, if you stored the needed DLLs in the "dlls" subdirectory of your project then this command will get them copied, only when necessary:
xcopy /d /y "$(ProjectDir)dlls\*.*" "$(OutDir)"
Use it both in the Debug and Release configuration so you'll debug exactly what you'll ship.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With