PDA

View Full Version : Linking problem



prosass
1st March 2007, 16:13
Hello everyone, I´m getting a LNK2019 unresolved external symbol with a dialog I created in QtDesigner and I can´t seem to be able to find the reason. I´m using VS 2005 with the integration set.

The dialog is called sizeofmapdialog.

I have this in mainwindow.cpp:


#include <QtGui>
#include <QGraphicsEllipseItem>
#include <QPointF>
#include <QImage>

#include "mainwindow.h"
#include "view.h"
#include "chip.h"
#include "sizeofmapdialog.h"

This in mainwindow.h:


class QFileDialog;
class QInputDialog;
class SizeOfMapDialog;

class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();


private slots:
void open();
void about();
void SizeOfMap();

private:
...
SizeOfMapDialog *dialog;

I have also checked the .pro file to see if the moc has included the files related to the dialog:

TEMPLATE = app
TARGET =
DEPENDPATH += . debug
INCLUDEPATH += .
QT += opengl

# Input
HEADERS += chip.h mainwindow.h sizeofmapdialog.h view.h
FORMS += sizeofmapdialog.ui
SOURCES += chip.cpp main.cpp mainwindow.cpp sizeofmapdialog.cpp view.cpp
RESOURCES += images.qrc

Where else can it be the linking problem with sizeofmapdialog?

Thanks in advance and regards.

fullmetalcoder
1st March 2007, 17:53
The relevant code is missing but here comes my wild guess : is the Q_OBJECT macro present in SizeOfMapDialog declaration???

jpn
1st March 2007, 17:56
Could you post the exact error?

prosass
2nd March 2007, 12:22
I was finally able to solve the problem. I was finally able to find a missing declaration in a mainwindow.h (actually it was in a wrong place). Thanks to jpn for his hint, I´ve seen in the forums that it´s quite usual to forget the Q_OBJECT macro, but it wasn´t this case.

Regards.