对引用的 C++ 使用 Debug-Only 后缀Visual Studio 2010 中的 DLL
在 Visual Studio 的早期版本(从 VC6 到 VS2008)中,我们习惯在调试构建 DLL 的名称末尾添加“D”,就像 MFC 和 CRT 库所做的那样。因此,例如,如果发布版本 DLL 是“foo.dll”、“bar.dll”和“baz.dll”,则调试版本名称是“fooD.dll”、“barD.dll”和“bazD.dll”。这可以防止我们意外地混合发布和调试 DLL。
然而,我们在使用 VS2010 中的新 C++ 构建系统执行此操作时遇到了困难。它在旧版本中与基于依赖关系的系统一起工作,但现在项目引用显然基于目标 DLL 名称,因此对于调试和发布版本来说它们似乎必须相同。
显而易见的解决方案是放弃调试构建后缀,但如果可能的话我们更愿意保留它。还有其他人这样做吗?他们是否知道如何使其与 VS2010 一起工作?
顺便说一句,我遇到了 使用 Visual Studio 项目属性有效地适用于多个项目和配置。我必须与其他团队成员一起审查它,以确定它是否可以解决我们的问题。
In previous versions of Visual Studio (from VC6 up to VS2008), we have had the convention of putting a "D" at the end of the names of debug-build DLLs, as is done for MFC and the CRT libraries. So, for example, if the release-build DLLs are "foo.dll", "bar.dll", and "baz.dll", the debug-build names are "fooD.dll", "barD.dll", and "bazD.dll". This prevents us from accidentally mixing release and debug DLLs.
However, we are having trouble doing this with the new C++ build system in VS2010. It worked with the dependency-based system in older releases, but now project references are apparently based upon the target DLL name, so it seems that they have to be the same for both Debug and Release builds.
The obvious solution is to just abandon the debug-build suffix, but we'd prefer to keep it if possible. Is anyone else doing this, and have they figured out how to make it work with VS2010?
BTW, I ran across Using Visual Studio project properties effectively for multiple projects and configurations. I'll have to review it with other team members to determine whether it might solve our problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论