如何使Visual Studio将DLL文件复制到输出目录? [英] How to make Visual Studio copy a DLL file to the output directory?

查看:646
本文介绍了如何使Visual Studio将DLL文件复制到输出目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个依赖于外部DLL文件的Visual Studio C ++项目。在构建项目时,如何使Visual Studio将此DLL文件自动复制到输出目录(debug / release)?

解决方案

在项目中使用后构建操作,并添加命令以复制违规DLL。 post-build操作是作为批处理脚本编写的。



输出目录可以被引用为 $(OutDir)。项目目录可以作为 $(ProjDir)。尝试在适用的情况下使用相对的贴图,以便您可以复制或移动项目文件夹,而不会影响后期制作。


I have a Visual Studio C++ project that relies on an external DLL file. How can I make Visual Studio copy this DLL file automatically into the output directory (debug/release) when I build the project?

解决方案

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). Try to use relative pathes where applicable, so that you can copy or move your project folder without breaking the post-build action.

这篇关于如何使Visual Studio将DLL文件复制到输出目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆