G
Guest
Hello dear .Net experts
I have created a Visual C++ class library (.net) project with two classes named Base and Derived wher
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 Bas
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 onc
using namespace System
namespace Commo
public __gc class Bas
public
Base(void){
~Base(void){
}
public __gc class Derived : public Bas
public
Derived(void){
}
Best regards
Michael
I have created a Visual C++ class library (.net) project with two classes named Base and Derived wher
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 Bas
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 onc
using namespace System
namespace Commo
public __gc class Bas
public
Base(void){
~Base(void){
}
public __gc class Derived : public Bas
public
Derived(void){
}
Best regards
Michael