I am working on a simple widget widget in Qt (all of them belong to the same class). In the header file, I defined
private:
QPointF translateToCanvas (QPointF input);
and in the CPP file I defined
QPointF translateToCanvas (QPointF input) {
return input - QPointF(CANVAS_MARGIN_X, CANVAS_MARGIN_Y);
}
Elsewhere in the code, I call it
QPointF newPoint = translateToCanvas(anotherPoint);
Whenever I compile, it gives me the error "undefined reference to" MyClass :: translateToCanvas (QPointF) ", and this happens inside the moc generating material, and not actually my literal.
What could be causing this error in Qt? (I am using Qt Creator with Qt 4.5.)
source
share