473,473 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

LINKER ERROR 1215

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?

Thanks in advance! : )
Nov 17 '05 #1
9 1988
"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
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


Nov 17 '05 #2
OK, got it down to where if I add a particular line it gets the linker
error, but if I comment it out it compiles. The line itself does not cause
the error, it's its existence (meaning the code is fine, in fact, this line
use to work before).

Maybe I have to actually REMOVE VS.NET 2003 and re-install from scratch?
Hate to do this and find out that's not the problem (it takes like 1.5 HOURS
to install)...

Should I contact MS? This is definitely a problem with THEIR linker...

I'll also go look to see if there is a service pack I don't know about... :)

HELP!!! I can't continue to program with this linker error...

[==P==]

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
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?

Thanks in advance! : )

Nov 17 '05 #3
> 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?
Hmmm. Not sure. If it is, it's because the System::Math class has this
problem. I say this because if I remove the following line from my code it
compiles just fine:

double rad = Math::Atan2( 1, 2 ) ;

With it I get the problem (but not always, some states of my source code
allow compiling even with this line, which is odd as well). So, if it's a
violation of the One Definition Rule then its the Math calss that's doing it
(IMHO)! :)

[==P==]

"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:ur**************@TK2MSFTNGP12.phx.gbl... "Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
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

Nov 17 '05 #4
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]" <cp*****************************@mvps.org.nospam >
wrote in message news:ur**************@TK2MSFTNGP12.phx.gbl...
"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
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

Nov 17 '05 #5
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==]

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
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]" <cp*****************************@mvps.org.nospam >
wrote in message news:ur**************@TK2MSFTNGP12.phx.gbl...
"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
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


Nov 17 '05 #6
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" <po*******@RoundTripInc.com> wrote in message
news:uv**************@TK2MSFTNGP14.phx.gbl...
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==]

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
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]"
<cp*****************************@mvps.org.nospam > wrote in message
news:ur**************@TK2MSFTNGP12.phx.gbl...
"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
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



Nov 17 '05 #7

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" <po*******@RoundTripInc.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
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" <po*******@RoundTripInc.com> wrote in message
news:uv**************@TK2MSFTNGP14.phx.gbl...
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==]

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
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]"
<cp*****************************@mvps.org.nospam > wrote in message
news:ur**************@TK2MSFTNGP12.phx.gbl...
"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uF**************@TK2MSFTNGP09.phx.gbl...
> 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




Nov 17 '05 #8
Ok, this is what I think happened. My program started out originally as a
2002 project. We upgraded to 2003. When I tried to open the 2002 project in
2003 it warned me and then converted it. But I don't think the conversion
was perfect. Note this conversion was done weeks ago, not just before
problem happened.

I believe now this conversion was the culprit. Because to solve the problem
I just opened a NEW 2003 project, copied the source files over, added them
in, and now it compiles fine (so far...hehe)! : )

[==P==]

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:uo**************@TK2MSFTNGP09.phx.gbl...

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" <po*******@RoundTripInc.com> wrote in message
news:e7**************@tk2msftngp13.phx.gbl...
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" <po*******@RoundTripInc.com> wrote in message
news:uv**************@TK2MSFTNGP14.phx.gbl...
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==]

"Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
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]"
<cp*****************************@mvps.org.nospam > wrote in message
news:ur**************@TK2MSFTNGP12.phx.gbl...
> "Peter Oliphant" <po*******@RoundTripInc.com> wrote in message
> news:uF**************@TK2MSFTNGP09.phx.gbl...
>> 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
>
>
>
>



Nov 17 '05 #9
Peter Oliphant wrote:
Ok, this is what I think happened. My program started out originally
as a 2002 project. We upgraded to 2003. When I tried to open the 2002
project in 2003 it warned me and then converted it. But I don't think
the conversion was perfect. Note this conversion was done weeks ago,
not just before problem happened.

I believe now this conversion was the culprit. Because to solve the
problem I just opened a NEW 2003 project, copied the source files
over, added them in, and now it compiles fine (so far...hehe)! : )


Glad to hear that you got it figured out. That does sound like a plausible
cause for the error. Is it possible that there was an .OBJ containing
managed code that wasn't being recompiled because of some mis-converted
setting?

It might also possible for settings to lead to ODR violations. I have no
idea if it was the case in your project, but the project conversion wizard
in 2002 and 2003 had bugs where it would mistakenly convert a project
setting into per-file settings. Subsequently, if you changed the project
setting, the change wouldn't be reflected to the converted files (but would
be reflected to newly added files). Among many other evils, that can lead
to ODR violations if various modules end up being compiled with, for
example, different #defines in effect.

-cd
Nov 17 '05 #10

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

Similar topics

12
by: Baloff | last post by:
Hello I have this linker error which makes me think that the definition file is not being seen by the linker, this code is taken from "Thinking in C++, 2nd Edition, Volume 1, Annotated Solutions...
1
by: Laszlo | last post by:
Hi all, As a novice I installed PostgreSQL 7.2.1 on Win32 and works, Borland C++Builder Enterprise Suite 5.0 (build 12.34) what works too. I decided to combine these two programs and develop a...
5
by: Pradnyesh Rane | last post by:
Hi, I am encountering the following linker error on VC7. LINK : fatal error LNK1171: unable to load ole32.dll This error is only encountered for the "Debug" configuration. The project...
3
by: Steve Baer | last post by:
I recently read your whitepaper under the "extremely long link times" post and have a question that I was hoping you could answer. My question is based on the following paragraph: Directives...
3
by: Chucker | last post by:
Hi Folks, I got a Wrapper Dll around a native C++ static library. In .NET 1.1 this worked fine. When moving to .NET 2.0 I get a couple of unresolved externals / linker errors: Error 16 error...
1
by: Felix | last post by:
After porting a project from VC6 to VC.NET 2003 I have a very strange problem generating link error 1104 for import libraries. I just ported the project and made some small adaptions so it fits...
4
by: yOtA | last post by:
I get this Linker Errors while compiling my program: Error: Unresolved external 'vminit()' referenced from C:\TESTE\TESTE.OBJ Error: Unresolved external 'vmalloc(void *, int, unsigned int,...
1
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- ...
3
by: Rahul | last post by:
Hi Everyone, I have the following polymorphic classes, class Shape { public : virtual void draw() { } virtual void sample();
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.