Devpartner Instrumentation 用于导致链接器错误的代码覆盖率

发布于 2024-07-29 18:07:43 字数 497 浏览 3 评论 0原文

因此,我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

早茶月光 2024-08-05 18:07:43

一位同事发现了这一点。
如果其他人遇到此问题:

项目中的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文