Unresolved external symbol "void __cdecl __CxxCallUnwindDtor

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Michael (anonymous_at_discussions.microsoft.com)
Date: 03/02/04


Date: Tue, 2 Mar 2004 01:31:06 -0800

Hello dear .Net experts,

I have created a Visual C++ class library (.net) project with two classes named Base and Derived where
Derived inherits from Base. When I add a destructur to base I get the following linker error:

Common.obj : error LNK2001: Unresolved external symbol "void __cdecl __CxxCallUnwindDtor(void (__thiscall*)(void *),void *)" (?__CxxCallUnwindDtor@@$$J0YAXP6EXPAX@Z0@Z)

This does not happen when there is no detructor in Base or when there is a destructor in Base
but no class derives from Base or when I put this code into a Visual C++ console application (.Net)
project. Is it not allowed for classes in libraries to have destructors ? I know about the problems
with destructors and garbage collected objects but I think it would be usefull as a fallback
mechanism to have the destructor cleanup the resources as a last resort.
Here is the example code:

#pragma once
using namespace System;
namespace Common
{
  public __gc class Base
  {
    public:
      Base(void){}
      ~Base(void){}
  };

  public __gc class Derived : public Base
  {
    public:
      Derived(void){}
  };
}

Best regards,
Michael



Relevant Pages

  • Re: destructor problems
    ... > i'm working on a project that derives a class from a base class (it's ... The base destructor is probably: ... I presume from what you say, that 'TAncestor' is a class written ... Don't make your own classes have a virtual constructor (unless you ...
    (alt.comp.lang.learn.c-cpp)
  • destructor problems
    ... i'm working on a project that derives a class from a base class (it's ... an aftermarket lib so i only have the headers to work with). ... understanding that i'll need to destroy these in the destructor for my ... i keep getting and error - Virtual function 'TMyClass::~TMyClass' ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Unresolved external symbol "void __cdecl __CxxCallUnwindDtor
    ... > Hello dear .Net experts, ... > Derived inherits from Base. ... > mechanism to have the destructor cleanup the resources as a last resort. ... > using namespace System; ...
    (microsoft.public.dotnet.languages.vc)