gpt4 book ai didi

c++ - 如何使用 Visual Studio 2012 构建 cppunit

转载 作者:行者123 更新时间:2023-11-30 02:57:00 34 4
gpt4 key购买 nike

我从 http://cppunit.svn.sourceforge.net/ 得到了 cppunit直到现在我需要在 Visual Studio 2012 中重建它时它都运行良好。

所以我从 ..\branches\HB_VS2010\cppunit\打开了解决方案,将所有项目更新为 v110,为发布配置添加了 x64 平台并尝试构建它。

发生的错误是error C2440: 'static_cast' : cannot convert from 'void (__cdecl cdxCDynamicDialog::* )(UINT)' to 'void (__cdecl CWnd::* )(UINT_PTR)'

当我尝试在 debug/win32 或 release/win32 中构建时 - 一切正常。

有人可以帮忙吗?

最佳答案

我在尝试为 64 位构建 cppunit 时遇到了与 Visual Studio 2008 相同的错误。对我有用的是更改其中两个函数的签名。

在类 cdxCDynamicDialog

afx_msg void OnTimer(UINT nIDEvent);

成为

afx_msg void OnTimer(UINT_PTR nIDEvent);

这样签名就会匹配 CDialog::OnTimer 函数。

接着我还更改了 cdxCDynamicWnd

void DoOnTimer(UINT nIDEvent);

成为

void DoOnTimer(UINT_PTR nIDEvent);

这不会导致 32 位构建出现问题,因为在该平台上 UINT 与 UINT_PTR 相同。

关于c++ - 如何使用 Visual Studio 2012 构建 cppunit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15003043/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com