PDA

View Full Version : undefined reference to `NESA::filterMeasurements(QStringList&, QString)



falconium
23rd March 2011, 23:25
I cannot compile my code due to the message above.

header:

class NESA : public QMainWindow
{
...
QStringList measurementNames;

void filterMeasurements(QStringList &list, QString measurementName);
}

source:

void filterMeasurements(QStringList &list, QString measurementName)
{
bool test = false;
foreach (QString name, list)
{
if (name == measurementName) test = true;
}
if (!test) list.append(measurementName);
}

I call it with filterMeasurements(measurementNames, "x");

Any guess? Thx!

Oh, and of course, the header is included in source.

#include "nesa.h"

Zlatomir
23rd March 2011, 23:28
This line:

void filterMeasurements(QStringList &list, QString measurementName)
should be something like:

void NESA::filterMeasurements(QStringList &list, QString measurementName)

progman
23rd March 2011, 23:29
Just a quick guess, but would it not be:

void NESA::filterMeasurements(......

falconium
23rd March 2011, 23:39
Uhhh, thanks, guys! What a simple mistake that caused headache for a long time. :)