error LNK2001 unresolved symbol
Code:
#include<iostream>
using namespace std;
class OprOvld{
public:
int var1,var2;
OprOvld();
OprOvld(int v1, int v2){
var1=v1;
var2=v2;
}
void display(){
cout<<var1<<endl;
cout<<var2<<endl;
}
OprOvld operator+ (OprOvld l);
};
OprOvld OprOvld::operator+ (OprOvld l){
OprOvld temp;
temp.var1=l.var1+var1;
temp.var2=l.var2+var2;
return temp;
}
int main(int argc, char* argv[]){
OprOvld ov1(1,5), ov2(3,6);
ov1.display();
ov2.display();
ov1=ov1+ov2;
ov1.display();
return 0;
}
for the above program I get Linker Error.... The error is pasted below
Linking...
Op_Ovld.obj : error LNK2001: unresolved external symbol "public: __thiscall OprOvld::OprOvld(void)" (??0OprOvld@@QAE@XZ)
Debug/Op_Ovld.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Can some one please help me with this Issue.
Re: error LNK2001 unresolved symbol
class OprOvld{
public:
int var1,var2;
OprOvld(){}
...
Re: error LNK2001 unresolved symbol
I am sure if you try a search for that number lnk2001 on this site you most likely will find your answer, i'm sure that most everybody had that error at one time or another in the past