Unresolved external symbol CxxCallUnwindDtor with exception handling on

R

Ralf Jablonski

Hello,

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:

Test.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.
If I disable exception handling for the compiler (remove /EHsc) then the
assembly is created.
Is exception handling not allowed with inheritance in C++ ?

Here is the example code:

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

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

Jacobo Rodriguez

Ralf said:
Hello,

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:

Test.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.
If I disable exception handling for the compiler (remove /EHsc) then the
assembly is created.
Is exception handling not allowed with inheritance in C++ ?

Here is the example code:

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

public __gc class Derived : public Base
{
public:
Derived(void){}
~Derived(void){}
};
}
have you any sentence like this?
try
{
....
}
catch(...)
{


}
you cant use catch(...), instead use catch(Exception *)


--
Jacobo Rodríguez Villar

Proyectos en desarrollo:

http://www.typhoonlabs.com
 
R

Ralf Jablonski

Until now I have no exception code inside this classes.
I want to use it, but because of the unresolved external I can't use it.
 
J

Jacobo Rodriguez

Ralf said:
Until now I have no exception code inside this classes.
I want to use it, but because of the unresolved external I can't use it.
I think that the problem is cased because you are unsing any C++
Standard feature doesn't allowed by MC++, like catch(...).
Review your code to check this :)

--
Jacobo Rodríguez Villar

Proyectos en desarrollo:

http://www.typhoonlabs.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top