xcopy 安装 Visual C++ 2008年运行时
是否可以通过简单地在程序文件夹中包含一些 dll 来使我的 C++ 应用程序在没有 Microsoft Visual C++ 2008 Redistributable Package
的计算机上运行?
我想让我的应用程序尽可能便携,并希望避免强制
安装运行时,那么这可能吗?
我不关心未来可能的运行时 .dll
更新和其他相关问题,我只是想为我的应用程序提供它可能需要的一切(在每个 Windows XP+< /代码> 机器)。有人遇到同样的问题吗?
谢谢。
Is it possible to make my C++ application run on a machine without Microsoft Visual C++ 2008 Redistributable Package
by simply including some dlls in the program folder?
I want to make my app as portable as possible and want to avoid forced
installation of the runtime, so is it possible?
I don't care about possible future runtime .dll
update and other troubles related, I simply want to supply my app with everything that it could possibly need (on every Windows XP+
machine). Did someone face the same problem?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
实际上,您可以链接静态运行时库,并且不需要重新分发任何运行时 DLL。有关如何链接静态运行时库的详细信息,请查看文档或 Visual Studio 帮助。
Actually, you can link with the static runtime libraries and you won't need to redistribute any of the runtime DLLs. Check the documentation or the Visual Studio help for details on how to link with the static runtime libraries.
是的,可以,但是要正确设置所有依赖项有点棘手。它并不像“将 msvcrt.dll 放入此文件夹中然后继续”那么简单。我已经做了你想做的事。这是不值得的。
有关参考,请参阅此处
如果您如果想要平衡保持代码较小和减少客户端依赖性,您可能需要考虑静态链接到 VC 运行时。
Yes, you can, but it's a little tricky to get all the dependencies right. It's not quite as simple as just "drop msvcrt.dll in to this folder and go." I've done what you're trying to do. It's not worth it.
For reference, see here
If you want to balance keeping your code small and reducing client-side dependancies, you may want to consider statically linking to the VC runtime.
Jim Mischel 的答案很好(+1),但有时你只需要 dll,但最终仍然想提供一个唯一的 exe。
然后,诸如 UPX 之类的工具来拯救......
Jim Mischel answer is good(+1), but sometime you just need to have dll but still want to provide a unique exe in the end.
Then, tools like UPX comes to rescue...