I am having linker errors :
error LNK2022: metadata operation failed (80131188) : Inconsistent field
declarations in duplicated types
This code linked sucessfully in C++.NET 2002, but does not link (causes
several of these metadata errors)
in C++.NET 2003.
I have a header file (.h) containing a class interface definition, and the
methods of the class, ctor, etc.
In the .cpp file, I have the actual class implementation. It seems like the
linker believes that these are two slightly
differently defined class definitions in 2003, while it was OK in 2002.
A. While this is the way you'd do it in classical C++, perhaps it's the
wrong way in .NET? The auto-generated
windows forms modules in .NET 2003 kind of work the other way around -- .H
contains the implementation & interface,
and .CPP contains a few includes.
B. I do not declare some PRIVATE: data members in the .H file, because I
don't want them visible to other modules
(this private data requires the use of #include objbase.h which
breaks the compilation of every .NET module that
includes it). The .CPP file instead declares those PRIVATE variables, and
contains the offending #include, and thus
does not affect the other module compilation. In 2002 this was OK, in 2003
it seems not to cause the linker
errors (but no compile errors).
If this is a newby question, could someone point me to how this separation
of interface and implementation should be
done in .NET?
-- Tom