fatal error LNK1215: metadata operation failed (80131192) :

Hello,
Im making a little game just to practise my skills. Today I was playing around with little changes in the code and suddenly Im not able to compile my program. Please anyone knows what this error is about? What could cause that?

1> .NETFramework,Version=v4.0.AssemblyAttributes.cpp
1>GierkaRPG.obj : fatal error LNK1215: metadata operation failed (80131192) :

EDIT:
I DLed Visual Studio 2008 (made some "version" changes to the code) and its working. You know Ive changed things like std::to_string or std::stoi which VS2008 doesnt know. I didnt change anything more and its working this time. Normally Im using VS2010. Still I would like to continue writing in VS2010 but I cant fix that error :(

EDIT2:
I found that: http://msdn.microsoft.com/en-us/library/ytad86xt.aspx
They said I should reinstall visual.
I tried to reinstall visual. Still the same error :(

EDIT3:
I was able to redo my code so its working again. I tried to make changes step by step. I noticed that error occurs when Im changing one of the... I would just post the code. Working:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct Umiejetnosci
{};
(...)
//Function prototype
int Obrazenia( int Skill, int S, int madrosc, int OdBroni, int RedukcjaRedukcji, int RedukcjaZPancerza );
(...)
//Usage example
obrazenia = Obrazenia( SkillPostaci/*(int)*/, nick.sila, nick.madrosc, WPrawejRece.WyplujBonusDoObrazen(), WPrawejRece.WyplujRedukcjeObrazen(), PancerzMoba.WyplujRedukcjeObrazen() );
(...)
//Function itself
int Obrazenia( int Skill, int S, int madrosc, int OdBroni, int RedukcjaRedukcji, int RedukcjaZPancerza )
{
	return 1;
}

Not working:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct Umiejetnosci
{};
(...)
//Function prototype
int Obrazenia( Umiejetnosci Skill, int S, int madrosc, int OdBroni, int RedukcjaRedukcji, int RedukcjaZPancerza );
(...)
//Usage example
obrazenia = Obrazenia( SkillPostaci /*(struct object)*/, nick.sila, nick.madrosc, WPrawejRece.WyplujBonusDoObrazen(), WPrawejRece.WyplujRedukcjeObrazen(), PancerzMoba.WyplujRedukcjeObrazen() );
(...)
//Function itself
int Obrazenia( Umiejetnosci Skill, int S, int madrosc, int OdBroni, int RedukcjaRedukcji, int RedukcjaZPancerza )
{
	return 1;
}

I realize that data names are not in English but I guess it doesnt really matter. What matters is that changing input data format form int into struct object is giving me that strange error. Can anyone help me? I dont know what should I do :(

EDIT4:
Ive made quite a lot of tests. I noticed that problem occures when Im trying to pass this structs object to function by value. My program is already doing this with other structs. The only difference between this struct and other is that that one actully has a constructor, its the only noticeable difference.
Last edited on
Sorry for that but bump. Really need to do something with that. But I cant do this on my own. Please somebody help me.
What do you mean by

" changing input data format form int into struct object is giving me that strange error."

Do you mean that you're trying to put it into Umiejetnosci
and it won't work?

Don't put this:
int Obrazenia( Umiejetnosci Skill, etc.

instead put

int Obrazenia(Umiejetnosci.Skill, etc.

and have Skill declared inside of the struct.
The format of a struct's value is:

structname.valueInTheStruct
Same thing with subprograms:
struct structname{
void structprogram(int a)
{
cout << a;
}
}

structname.structprogram(a)

Struct Umiejetnosci
{
int Skill;
}
Last edited on
As far as I know your method with Umiejetnosci.Skill will send only 1 variable. I want to send whole struct like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
struct StructName
{
int ID;
std::string name;
int AdditionalValue;
}
(...)
int Function( StructName Struct1 )
{
std::cout << Struct1.ID << Struct1.Name << Struct1. AdditionalValue;
}
(...)
StructName AStruct;
AStruct.ID = 1;
AStruct.Name = "Name";
AStruct.AdditionalValue = 2;
Function( AStruct );//Sending whole data 

Is it incorrect? I already did it and it works :D with other structs :(

EDIT:
I read somewhere that if you have big struct you should pass value by reference. Since today I was always passing it by value. Its working when Im passing it by reference. Maybe the struct was to big and compiler was doing something wrong? The funny thing is that it was working in VS2008 and the same code didnt in VS2010. So the actuall error isnt really solved but the program works so Ill mark it as solved.
Last edited on
Is value structName.thing

or is it structName substruct?

Topic archived. No new replies allowed.