hello..
Can anybody tell me how to remove the linker error as mentioned above..
i have created a simple program in C++ as given below
#include<iostream.h>
#include<conio.h>
void add(int a,int b);
void sub(int a,int b);
void mul(int a,int b);
void div(int a,int b);
class nikita
{
float c;
void add(int a,int b)
{
c=a+b;
cout<<"addition="<< c;
}
void sub(int a,int b)
{
c=a-b;
cout<<"substraction"<< c;
}
void mul(int a,int b)
{
c=a*b;
cout<<"multiplication"<< c;
}
void div(int a,int b)
{
c=a/b;
cout<<"div="<< c;
}
};
void main()
{
int a,b;
cout<<"enter the value of a";
cin>>a;
cout <<"enter the value of b";
cin>>b;
add(a,b);
sub(a,b);
mul(a,b);
div(a,b);
getch();
}
i saved it with name PIYUSHAN.cpp.after compiling above program, it shows no errors, that means it get compiled successfully. but when I try to run this program it shows Linker error : Undefined symbol add(int,int) in module PIYUSHAN.CPP
Linker error : Undefined symbol sub(int,int) in module PIYUSHAN.CPP
Linker error : Undefined symbol mul(int,int) in module PIYUSHAN.CPP
Linker error : Undefined symbol div(int,int) in module PIYUSHAN.CPP
Please help me out whats the problem and how to remove it....