Look at the following codes:
// C4150.cpp
// compile with: /W2
class IncClass;
void NoDestruct( IncClass* pIncClass )
{
delete pIncClass;
} // C4150, define class to resolve
Reason: The compiler warning is because the compiler was unable to find the type IncClass's destructor.Solution: Put the implementation of IncClass to header file and include the file in this CPP.
本文探讨了C4150警告的原因及其解决方案。该警告通常出现在删除一个未定义析构函数的对象时。文中通过一个示例展示了如何将类的实现移至头文件中以解决此问题。

被折叠的 条评论
为什么被折叠?



