I trying to add in this function below to my class
vector<string> &split(const string &s, char delim, vector<string> &elems) {
    stringstream ss(s);
    string item;
    while(getline(ss, item, delim)) {
        elems.push_back(item);
    }
    return elems;
}
vector<string> split(const string &s, char delim) {
    vector<string> elems;
    return split(s, delim, elems);
}
Below is my class file
#ifndef LOGIN_H  
#define LOGIN_H
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <iostream>
using namespace std;
    class Login
    {
    private:
    ifstream infile;
    string sLine,username,password;
    stringstream ss;
    int counter,logCounter;
    bool verify,end;
    public:
    Login();
    Login(string,string);
    bool loginValidate(string,string);
    };
    Login::Login()
    {
    }
    Login::Login(string user,string pass)
    {
    username=user;
    password=pass;
    }
    bool Login::loginValidate(string user,string pass)
    {
    bool result,verify;
    result=false;
    /* Begin Read account File */
    infile.open("account.txt");
    if(infile.is_open())
    {
    while (infile.good())
    {
    getline(infile, sLine);
    if(sLine!="")
    {
    //do vector split
    vector<string> x = split(sLine,':');
    x.clear();
    }//end if sLine
    }//end while loop
    }//end if
    infile.close();
    return result;
    }//end function loginValidate
    #endif
I am trying to use the split function in my loginValidate function of login - Login Class but i try declare it at above login validate and i get some errors like
 user1@ubuntu:~/yes222/New folder$ g++ test.cpp login.cpp -o main
    /tmp/ccv6uiN1.o: In function `split(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
    login.cpp:(.text+0x0): multiple definition of `split(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)'
    /tmp/ccCcz7T2.o:test.cpp:(.text+0x0): first defined here
    /tmp/ccv6uiN1.o: In function `split(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char)':
    login.cpp:(.text+0xe9): multiple definition of `split(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char)'
    /tmp/ccCcz7T2.o:test.cpp:(.text+0xe9): first defined here
    collect2: ld returned 1 exit status
    user1@ubuntu:~/yes222/New folder$ g++ test.cpp login.cpp -o main
    login.cpp: In member function ‘bool Login::loginValidate(std::string, std::string)’:
Can anyone guide me . thanks!
The function previously i just use all in a main class, but now i trying to split the login part to another class thus i got a issue with using this function in that class..
 
     
    