473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

.H, .CPP files, differences in linker behavior 2002 vs 2003

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

Nov 17 '05 #1
0 2196

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Derek | last post by:
I have VS.Net 2003 and I can't open any .sln files (even if they are from a new 2003 project that I just created) - When I click on the .sln file, VS.Net pops up saying that: "The selected file is...
11
by: Steven T. Hatton | last post by:
In the past there have been lengthy discussiions regarding the role of header files in C++. People have been very adamat about header files serving as in interface to the implementation. I do...
2
by: BT Openworld | last post by:
I have just had to upgrade to Access 2003 as Access 97 EMail (SendObject) doesn't work when loaded on Windows XP. I'm finding my way around Access 2003 but my biggest problem is getting...
7
by: Wayne Aprato | last post by:
I have several Access 2003 mde databases. When I try to open them in Access 2002 I get the following error: "The Visual Basic for Applications project in the database is corrupt." ...
2
by: Kevin Joplin | last post by:
Hi there, I've almost finished writing simple server application and i have one little doubt. Suppose we have main server code in server.c file. Rest of the code we divided into some pices and put...
2
by: Dave Girvitz | last post by:
Yesterday I was giving a presentation on the Trace Class to my user's group. For the purposes of the presentation, I wrote a quick app that used a configuration file to set the TraceLevel of my...
3
by: =?Utf-8?B?SmVmZnJleQ==?= | last post by:
Just got the book, ASP.NET by Greg Buczek (Osborne). The first part of book listed many aspx codes, not created by VS 2003 or VS 2005. How can these aspx files be coded? NotePad or VB 6? The...
2
by: Michael R | last post by:
Hello. I've been writting an Access app on office 2003 for sometime, and couldn't find any info on the net on what are the differences between the 2 formats, and why should I use Access 2002-2003...
6
by: The Architect | last post by:
Hi, If I have the same symbol in the .data section of 2 obj files, LD gives a multiple declaration error on linking? Would like to know the reason for this (diab only issues a warning) Also...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.