It says that there are functions with names Trinti and Tvarkyti that have same argument lists, though thats nto this case. Am i missing something here??
It says that there are functions with names Trinti and Tvarkyti that have same argument lists, though thats nto this case. Am i missing something here??
Yes. You're missing something. That's not what it says at all. It says there is an uresolved exrernal symbol (a function the linker can't find) with the prototype void Trinti(Klipas) that is referenced called in pagrindinis.cpp.
The second error says there is an unresolved external symbol with the prototype void Tvarkyti(Klipas& Klipas&, int, int) which is called from main.
These declarations, are taken from pagrindinis.cpp:
1 2
void Tvarkyti(Klipas & K, Klipas & S, int rezX, int rezY);
void Trinti(Klipas K);
Notice that they match the prototypes for the unresolved externals - ie. you told the compiler you were going to define those functions. However, in pagrindinis.cpp we see that you actually defined the functions in a different way:
1 2 3 4
void Tvarkyti(Klipas & K, Klipas & S, int & rezX, int & rezY)
{
int n=0;
// ...
and
1 2 3 4
void Trinti(Klipas & K)
{
int i=0;
// ...
You will notice that the parameter types for these functions do not match the parameter types for the declarations that occurred earlier in the code, and when the linker is looking for those functions, it's not going to find these functions.
The solution: Make sure the declarations match the definitions.