Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall MyForm::MyForm(class QWidge..........



  • mainwindow.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall MyForm::MyForm(class QWidget *)" (??0MyForm@@QAE@PAVQWidget@@@Z) referenced in function "private: void __thiscall MainWindow::on_pushButton_clicked(void)" (?on_pushButton_clicked@MainWindow@@AAEXXZ)
    

    ============================================================

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "myform.h"
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    void MainWindow::on_pushButton_clicked()
    {
        MyForm *dialoge = new MyForm();
        dialoge->show();
    }
    

    [edit: Added missing codings tags SGaist]



  • How is defined the Myform constructor?

    Is MyForm defined in your .pro file?


Log in to reply