未解决的外部符号LNK2019 Qt Creator

时间:2017-03-06 20:32:05

标签: c++ qt qt-creator unresolved-external

我可能已经看过讨论这个问题的所有主题,但我仍然无法修复它

#pragma once

#include <QObject>
#include <QApplication>
#include <QObject>
#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QHBoxLayout>

class input : public QObject {

    Q_OBJECT

public:
    input();

public slots:
  void text();


signals:
    void buttonclicked();


private:
    QWidget * w = new QWidget;
    QPushButton * ok = new QPushButton;
    QLineEdit * line = new QLineEdit;
    QHBoxLayout * layout = new QHBoxLayout;
};

这是一个非常简单的标题,但还没有实现 但是当我构建它以检查代码时它会给我这个错误而我无法真正解决它

moc_clss.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl input::text(void)" (?text@input@@QEAAXXZ) referenced in function "private: static void __cdecl input::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@input@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z)

如果可以,请帮忙。

0 个答案:

没有答案