C++ Linker error with Dispose

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

In a C++ class library project, the following code:

public __gc class A
{
public:
~A(){}
};

public __gc class B: public A
{
public:
~B(){}
};

gives me:

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

It compiles fine in a Windows Forms project. If I disable "C++ Exceptions"
in the class library project, it also compiles. Is this a linker bug or am I
doing something wrong?

Thanks
 
I found the same problem recently. Adding msvcrt.lib to the project solved
it, but I still do not know why... Some info about this in MSDN would be
useful, I have lost hours to resolve the problem.

Zdenek
 
Back
Top