title: How to delete an object of a polymorphic class type that has no virtual destructor
body: <p>I am getting the following error when I try to compile some code from a Third-party SDK.</p>
  
  <pre><code>*Description    Resource    Path    Location    Type
  deleting object of polymorphic class type ‘Vendor_sys::VendorCode’ which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor]   PnServer.cpp    /PCounter   line 467    C/C++ Problem*
  </code></pre>
  
  <hr>
  
  <p>I do not know if its possible to satisfy this condition with only partial knowledge of the Vendor's SDK, where most of the heavy lifting is done in a dll or library object.</p>
  
  <p>My build environment is Eclipse Juno with gpp.</p>
  
  <p>I searched in Google for the error message and did not find any instances of this error.</p>
  
  <p>So, if I cannot modify the black box part of the vendor code, what are my options?</p>
  
  <p>Here is the code that is failing during the make process:</p>
  
  <pre><code>delete pData-&gt;unit;
  </code></pre>