I guess I need to call Customer Support. Is there such a thing to solve
compiling problems? My company JUST ordered MSDN subscription so we get
this for free for a certain number of incidents/time-length, right?
This is why I can't solve the problem myself. I can add a function I don't
even call, does very little, and is definitely NOT named something I've
named something else, in fact, here is the line:
static double ABCXYZ( ) { return 0 ; }
and it generates the error with this line, and doesn't without it. This is
located in a class I call 'global_funcs' (where I store static functions I
wish to be able to access via delegates from anyplace in code).
global_funcs has other functions in it that work just fine.
How could adding this line POSSIBLY cause a LNK1215 error, since it goes
away if I remove it? I can call the function anything and it does this
(not just ABCXYZ). At the very least the linker is reporting the wrong
problem or its reporting a phantom error...
What should I do? I can't give you the code, its too big and it is
propietary...
[==P==]
Peter Oliphant said:
Ok, it isn't the MATH class either (I've removed this line and caused it
to happen without it). It seems to do it 'randomly', in that it sometimes
gives this error, sometimes doesn't. And it happens when I add code that
should have no affect on such a thing. I mean, if I have a doubly define
thing in my program, why wouldn't it report it to me ALWAYS, not just
when I add some code that is not defining anything?
This is very frustrating since it isn't giving me the information I need
to fix this problem, and I'm can't work at all till I get this resolved.
If it is somehow my double-defining something, is there a way to get the
complier to tell me WHAT is being re-defined?
[==P==]
Peter Oliphant said:
BTW, if LNK1215 is the result of two things being re-defined (which the
explanation for the error really doesn't say at all, it says it has a
"bad HRESULT due to a metadata update", which is extremely UNCLEAR if
this means its a re-define of some thing in my code), WHY in heck
doesn't it say something like "and the NAME of the thing re-defined is
<such-and-such>"? Obviously it knows the name of what was re-defined (or
else it couldn't know it was re-defined), so why doesn't it tell US this
info? Why should we have to figure out something it already knows? : )
[==P==]
BTW, the explanation for this error clearly says to re-install C++:
Linker Tools Error LNK1215
metadata operation failed (HRESULT) : error
The linker received an error from the .NET runtime while attempting to
do a metadata update through the .NET runtime.
HRESULT is the HRESULT from the .NET runtime method. error is the
.NET-supplied text.
You probably have a mismatched linker and .NET runtime; reinstall
Visual C++.
[==P==]
"Carl Daniel [VC++ MVP]"
For some reson my code is generating a LNK1215 error, which
'suggests' I re-install VS C++. So I did. which did NOT solve the
problem. The weid part is it seems to be caused by my one CPP file,
but not sure how. It compiled just fine. Then I made a simple change
and re-compiled, and got the 1215 error. After that I have to bring
back in an old version of the code to make it work again (not fun)...
This seems like a REAL LINKER error, not my cause.
Is this some known problem with the linker, and is there a solution?
No, it's not a linker problem, it's a real problem with your project.
The advise to reinstall VC++ is odd - I don't recall hearing of that
ever fixing the problem.
From what I understand, the main cause of this error is violations of
the One Definition Rule in C++. In other words, you have a thing (a
class, for example), that has more than a single definition.
A simple way to produce this error is to mix the class and struct
keywords on the same type. Under VC++ that results in two different
types with different decorated names, and will result in this error if
you're generating managed code. Could that be your problem?
-cd