c++visual-studio-2012cppunit

How to build cppunit with Visual Studio 2012


I've got cppunit from http://cppunit.svn.sourceforge.net/ and it worked fine until now, when I need to rebuild it in Visual Studio 2012.

So I've opened solution from ..\branches\HB_VS2010\cppunit, updated all projects to v110, added x64 platform for release configuration and tried to build it.

The error that occurred is error C2440: 'static_cast' : cannot convert from 'void (__cdecl cdxCDynamicDialog::* )(UINT)' to 'void (__cdecl CWnd::* )(UINT_PTR)'

When I try to build in debug/win32 or release/win32 - everything works fine. What can I try next?


Solution

  • I ran into the same error with Visual Studio 2008 trying to build cppunit for 64-bit. What worked for me was changing the signature of two of the functions.

    In the class cdxCDynamicDialog

    afx_msg void OnTimer(UINT nIDEvent);
    

    became

    afx_msg void OnTimer(UINT_PTR nIDEvent);
    

    so that the signature would match the CDialog::OnTimer function.

    Following this through I also changed cdxCDynamicWnd

    void DoOnTimer(UINT nIDEvent);
    

    became

    void DoOnTimer(UINT_PTR nIDEvent);
    

    This doesn't cause issues in the 32-bit build because on that platform UINT is the same as UINT_PTR.