So GCC keeps spouting out this error that keeps boggling my mind
undefined reference to 'GPS::isValidSentence(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
my header file parseNMEA.h
is as follows:
#ifndef PARSENMEA_H_211217
#define PARSENMEA_H_211217
#include <string>
#include <list>
#include <vector>
#include <utility>
#include "position.h"
namespace GPS
{
using std::string;
using std::vector;
using std::pair;
bool isValidSentence(const string &);
}
#endif
and my source file parseNMEA.cpp
is:
#include "parseNMEA.h"
using namespace GPS;
bool isValidSentence(const string &n)
{
string test = n;
bool result;
if (test.find("$GP") != string::npos) //Find the prefix
{
if (test.size() > 5) //Check if it has 3 char identifier
{
//check if it has ',' after identifier
if (test[6] == ',')
{
//check for a '*'
if(test.find("*",7))
{
result = true;
}
}
}
}
else
result = false;
return result;
}
Any ideas as to whats going on? I've tried bool isValidSentence (const string &n)
in the header file but the same error code