Linker error

I generated this code using QT and I'm getting a linker error I'm using Visual Studio 2012.
I'm getting LKN2019 unresolved external symbol "public:--cded MyDialog::MyDialog(class QWidget*)" mainwindow.obj referenced in fuction "private:void__cded MainWindow::on_actionNew_window_triggered(void)"(?

//This is my main
#include "mainwindow.h"
#include <QApplication>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}

//This MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "mydialog.h"

MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setCentralWidget(ui->plainTextEdit);
}

MainWindow::~MainWindow()
{
delete ui;

}

void MainWindow::on_actionNew_window_triggered()
{
MyDialog mD;
mD.setModal(true);
mD.exec();
}

//this is mydialog
#include "mydialog.h"
#include "ui_mydialog.h"

MyDialog::MyDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MyDialog)
{
ui->setupUi(this);
}

MyDialog::~MyDialog()
{
delete ui;
}
Last edited on
I fixed it.
Topic archived. No new replies allowed.