G
Gary Hughes
Hi all, sometime I posted a problem in here where I was
getting the following error from the linker in VS C++ 2003.
Linking...
GCClass.obj : error LNK2022: metadata operation failed
(80131188) : Inconsistent field declarations in duplicated
types (types: GCClass; fields: m_blah): (0x04000001).
LINK : fatal error LNK1215: metadata operation failed
(80131130) :
At the time I was unable to produce a simple test case and
due to time constraints I had to leave the problem. I had
another go at it today and was able to produce a simple
test case. The code follows:
namespace itga
{
template<typename Type>
class dog
{
public:
class blah {};
};
}
public __gc class GCClass
{
itga::dog<int>::blah* m_blah;
};
If I attempt to instantiate GCClass as follows I get the
error above.
GCClass* g = new GCClass;
There are two things I can do to get rid of the error:
1. put the dog class outside the itga namespace.
2. not make the dog class a template.
Neither of these is possible nor desirable as I'm just
trying to wrap a heap of existing C++ code in .NET
wrappers and as far as I am concerned this seems perfectly
legal to me.
Does anyone have any idea what is going on here?
thanks.
Gary.
getting the following error from the linker in VS C++ 2003.
Linking...
GCClass.obj : error LNK2022: metadata operation failed
(80131188) : Inconsistent field declarations in duplicated
types (types: GCClass; fields: m_blah): (0x04000001).
LINK : fatal error LNK1215: metadata operation failed
(80131130) :
At the time I was unable to produce a simple test case and
due to time constraints I had to leave the problem. I had
another go at it today and was able to produce a simple
test case. The code follows:
namespace itga
{
template<typename Type>
class dog
{
public:
class blah {};
};
}
public __gc class GCClass
{
itga::dog<int>::blah* m_blah;
};
If I attempt to instantiate GCClass as follows I get the
error above.
GCClass* g = new GCClass;
There are two things I can do to get rid of the error:
1. put the dog class outside the itga namespace.
2. not make the dog class a template.
Neither of these is possible nor desirable as I'm just
trying to wrap a heap of existing C++ code in .NET
wrappers and as far as I am concerned this seems perfectly
legal to me.
Does anyone have any idea what is going on here?
thanks.
Gary.