I'm a Qt beginner, I have the 5.2.1 version and I was trying to learn Qt/QML from a book on Github. However, this is one of the most basic examples:
#ifndef CUSTOMWIDGET_H
#define CUSTOMWIDGET_H
#include <QtWidgets>
class CustomWidget : public QWidget
{
Q_OBJECT
public:
explicit CustomWidget(QWidget *parent = 0);
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
private:
QPoint m_lastPos;
};
#endif // CUSTOMWIDGET_H
And here are the errors I get:
ln function `_start'
undefined reference to `main'
collect2: ld returned 1 exit status
I have no idea what any of these mean, so any help would be appreciated. I made the project as a Qt Quick Application.
These are included in the .pro
file
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets