When i try to compile i get this error : [Linker error] undefined reference to `Functii::sortare(std::vector<persoana, std::allocator<persoana> >)'
I have my function declared in Functii.h as follows :
#include <vector>
using namespace std;
struct persoana
{ int id;
string nume;
};
class Functii
{
public:
static void sortare(vector<persoana> vp);
.......
And the function body in the Functii.cpp file as follows :
#include "Functii.h"
....
void sortare(vector<persoana> vp)
{
sort(vp.begin(),vp.end(),compare);
for_each(vp.begin(),vp.end(),ffe);
}
And call it from the main.cpp file :
Functii::sortare(vp); //with vp being a vector<persoana>.
I get the same error for another function also and i checked for spelling and case sensitivity when i included the .h files. Also i am using dev c++. Any sugestions pls?