检查所有库和 dll 是否来自同一版本?
我正在 VS C++ 2008 中开发一个程序。
现在,我有一个巨大的 dll 和 lib 依赖项列表,并且我正在添加更多依赖项。我担心,当我需要通过从源代码构建来更新依赖项时(我必须在正确的位置手动替换构建的 dll 和库),如果我不小心忘记替换某些内容,反之亦然,我可能会遇到编译和/或运行时问题。而且找出哪个地方出了问题可能有点困难。
那么是否有某种程序或方法可以适合此任务,以轻松构建具有许多更新依赖项的程序?
I am developing a program in VS C++ 2008.
Right now, I have a huge list of dll and lib dependencies and I am adding some more. I worry that when I need to update a dependency by building from source (where I have to manually replace built dlls and libs in the correct place), if I accidently forgot to replace something or vice versa, I may run into a compile and/or runtime problem. And finding which place goes wrong can be a bit difficult.
So is there some sort of program or method out there that can suit this task to ease building a program with many updating dependencies?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以将脚本作为构建后步骤添加到 DLL 项目中,这些项目会自动将结果复制到公共目录中(类似
$(SolutionDir)$(ConfigurationName)
可能没问题,除非您使用不同的项目配置对于相同的解决方案配置)。或者您只需将所有项目的输出目录设置为这样一个公共目录。然后,当您构建整个解决方案时,您就知道该目录中拥有所有这些文件的最新版本。
You could add scripts as post-build steps into your DLL projects which automatically copy the results into a common directory (something like
$(SolutionDir)$(ConfigurationName)
might be fine, unless you use different projects configurations for the same solution configuration). Or you just set all the projects' output directories to such a common directory.Then, when you build the whole solution, you know you have the latest versions of all these files in that directory.
避免让事情变得复杂。 Visual Studio 解决方案可以包含构建所有依赖项所需的任意数量的项目。 Build + Clean 将删除所有二进制文件,Build + Build 将重建它们。只需确保“构建 + 清理”删除您所依赖的每个 .lib 即可。
Avoid making this complicated. A Visual Studio solution can contain as many projects as you need to build all dependencies. Build + Clean will delete all binaries, Build + Build will rebuild them. Just make sure that Build + Clean deletes every .lib that you've got a dependency on.
Refix 是一个检查依赖关系的好工具:http://refix.codeplex.com/
Refix is a great tool for checking dependencies: http://refix.codeplex.com/