PunCha

导航

Compiler Warning C4150: deletion of pointer to incomplete type 'XXX'; no destructor called

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.
 



posted on 2008-06-03 15:24  PunCha  阅读(270)  评论(0编辑  收藏  举报