Unresolved external symbol in qt project : <p>Okay so spend 30 min or so having a look at common causes for this issue and I can't see what is wrong. </p>

<p>The error I am getting is unresolved external symbol. The symbol in question being a class called AdventureDocs. The header is as follows.</p>

<pre><code>#ifndef ADVENTUREDOCS_H
#define ADVENTUREDOCS_H

#include &lt;QWidget&gt;

class AdventureDocs : public QWidget
{
    Q_OBJECT
public:
    AdventureDocs(QObject *parent);
};

#endif // ADVENTUREDOCS_H
</code></pre>

<p>and the cpp</p>

<pre><code>#include "adventuredocs.h"
#include &lt;QHBoxLayout&gt;
#include &lt;QVBoxLayout&gt;
#include &lt;QPushButton&gt;
#include &lt;QLabel&gt;
#include &lt;QTabWidget&gt;

AdventureDocs::AdventureDocs(QObject *parent): QWidget(parent)
{
    QHBoxLayout *hLayout = 0;
    QVBoxLayout *vLayout = 0;
    QPushButton *button = 0;
    QLabel *label = 0;

    hLayout = new QHBoxLayout();
    Q_ASSERT(hLayout);

    vLayout = new QVBoxLayout();
    Q_ASSERT(vLayout);

    // Set the layout to the widget
    setLayout(hLayout);
    hLayout-&gt;addLayout(vLayout);

    // Draw widgets on main page.
    label = new QLabel(hLayout);
    Q_ASSERT(label);
    hLayout-&gt;addWidget(label);

    label-&gt;setText("Adventure Docs");
}
</code></pre>

<p>This is a class not a library or anything smart like that I used add new class in qt creator to add it and that added the header and cpp into the project file as follows.</p>

<pre><code>#-------------------------------------------------
#
# Project created by QtCreator 2016-06-12T11:06:47
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = AdventureDocs
TEMPLATE = app


SOURCES += main.cpp\
        mainwindow.cpp \
    adventuredocs.cpp

HEADERS  += mainwindow.h \
    adventuredocs.h

FORMS    += mainwindow.ui
</code></pre>

<p>finally in the mainwindow .cpp where i create an AdventureDocs object is where i get the error.</p>

<pre><code>#include "mainwindow.h"
#include "ui_mainwindow.h"
#include &lt;QPushButton&gt;
#include "adventuredocs.h"
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui-&gt;setupUi(this);
    AdventureDocs *main = 0;

    main =  new AdventureDocs(this);
    if (main != 0)
    {
        setCentralWidget(main);
    }
}

MainWindow::~MainWindow()
{
    delete ui;
}
</code></pre>

<p>Can someone point out the bleeding obvious which I am clearly missing thanks.</p>
