运行.exe而不复制.dlls [英] Running .exe without copying .dlls
问题描述
我有Visual Studio 2015解决方案准备交货。我有一个要求.exe应该开箱即用。但是,我得到missing dll ...错误。有没有什么方法,我可以让人有可能运行exe,而他不需要下载一堆ddls?
I have Visual Studio 2015 solution ready for delivery. I have a requirement that the .exe should run out of the box. However, I am getting "missing dll..." errors. Is there any way I could make it possible for someone to run the exe without him needing to download bunch of ddls? Can I build the .exe to be executable as stand-alone somehow?
推荐答案
是的,你必须静态链接二进制文件。在项目设置(配置属性 - > C / C ++ - >代码生成)中,分别使用/ MT,/ MTd进行发布,调试配置。但是,这会增加可执行文件的大小。
Yes, you have to statically link the binary. In the project settings (Configuration Properties -> C/C++ -> Code Generation), use /MT, /MTd for the Release, Debug configurations respectively. However, this bloats the size of the executable.
这篇关于运行.exe而不复制.dlls的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!