I am trying to define a function searchview::run() in a source file ("searchview.cpp"), after it has been declared in my header file ("searchview.h"). When I do this, I am getting an error code saying that there are multiple definitions of searchview::run(), and it is first defined on line 5. Both error codes point to line 5, and it is defined only in the source file and declared only in the header file.
searchview.h
using namespace std;
class Searchview {
public:
void run();
};
And searchview.cpp
#include "searchview.h"
using namespace std;
void Searchview::run() {
while(!search_results.empty()) {
cout << "No results found" << endl;
}
}