I am having a problem using destructors in managed C++ and
would appreciate help in finding a solution.
Thanks
Mark
----------- Error and Test Code -------------------------
The linker throws this error when the code below is built:
testmanagedCxx error LNK2001: unresolved external
symbol "void __cdecl __CxxCallUnwind Dtor(void (__thiscall*)
(void *),void *)" (?
__CxxCallUnwind Dtor@@$$J0YAXP6 EXPAX@Z0@Z)
// This is the main DLL file.
#include "stdafx.h"
#include "testmanagedCxx .h" // the header does not
contain any code
namespace testmanagedCxx
{
public __gc class Base
{
private:
String *s;
public:
Base() { s = new String(L"hello" ); }
~Base() { s = 0; }
};
public __gc class Derived : public Base
{
public:
Derived() {}
~Derived() {}
};
}
would appreciate help in finding a solution.
Thanks
Mark
----------- Error and Test Code -------------------------
The linker throws this error when the code below is built:
testmanagedCxx error LNK2001: unresolved external
symbol "void __cdecl __CxxCallUnwind Dtor(void (__thiscall*)
(void *),void *)" (?
__CxxCallUnwind Dtor@@$$J0YAXP6 EXPAX@Z0@Z)
// This is the main DLL file.
#include "stdafx.h"
#include "testmanagedCxx .h" // the header does not
contain any code
namespace testmanagedCxx
{
public __gc class Base
{
private:
String *s;
public:
Base() { s = new String(L"hello" ); }
~Base() { s = 0; }
};
public __gc class Derived : public Base
{
public:
Derived() {}
~Derived() {}
};
}
Comment