Devpartner Instrumentation 用于导致链接器错误的代码覆盖率
因此,我有一个 Visual studio 2005 解决方案,其中包含一个 C# 项目(测试驱动程序 - 创建 exe)和 7 个 C++ 项目(dll)。
到目前为止,该解决方案构建得很好。
我安装了 DevPartner studio 8.2。 我正在尝试对整个解决方案生成测试覆盖率,这需要我在构建期间检测本机 C++ 代码。 当我打开此 DevPartner 选项时,构建会产生链接器错误。
有人对此有经验吗?
例如:
Error 25 error LNK2001: unresolved external symbol "public: __thiscall IntLong::IntLong(class BufObjBase *,int,int,unsigned char,wchar_t const *,bool)" (??0IntLong@@QAE@PAVBufObjBase@@HHEPB_W_N@Z) X.obj
So I've got a Visual studio 2005 solution that contains a C# project (test driver - creates exe) and 7 C++ Projects (dll's).
This solution builds fine up to this point.
I have DevPartner studio 8.2 installed. I am trying to generate test coverage on the entire solution which requires me to instrument native c++ code during builds. when I turn this DevPartner option on, the build produces linker errors.
Does anyone have experience with this?
For example:
Error 25 error LNK2001: unresolved external symbol "public: __thiscall IntLong::IntLong(class BufObjBase *,int,int,unsigned char,wchar_t const *,bool)" (??0IntLong@@QAE@PAVBufObjBase@@HHEPB_W_N@Z) X.obj
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一位同事发现了这一点。
如果其他人遇到此问题:
项目中的 dll、其他 dll 和库之间存在依赖链。 在正常构建下,Visual Studio 足够智能来找到库。 随着 DevPartner 插入其工具,情况并非如此。
确保在(出现链接错误的项目属性)-> 中明确指定所有其他依赖项 链接器-> 输入-> 附加依赖项。
A co-worker figured this out.
In case anyone else runs into this problem:
There is a dependency chain in the project between dlls, other dlls, and libraries. Under a normal build, visual studio is smart enough to find the libraries. With DevPartner inserting its instrumentation, it isn't.
Make sure all additional dependencies are explicitly specified in (properties on project getting the link error) -> Linker -> input -> Additional Dependencies.