qml - Custom Qt widget example in Qt Creator errors -
i'm qt beginner, have 5.2.1 version , trying learn qt/qml book on github. however, 1 of 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 errors get:
ln function `_start'
undefined reference `main'
collect2: ld returned 1 exit status
i have no idea of these mean, appreciated. made project qt quick application.
these included in .pro
file
qt += core gui greaterthan(qt_major_version, 4): qt += widgets
first should go google , errors, can find them , solution, , solutions here in stackoverflow too.
for can , hope helps you:
ln function _start'
don't know mean, can copy full error? maybe this can youundefined reference main'
doing example in new project supose there no main() function, basic program run. can add main.cpp or declare globalyvoid main() {}
try looking @ this , thiscollect2: ld returned 1 exit status
means wrong (there errors before line), that's why last error.
Comments
Post a Comment