PDA

View Full Version : [SIZE="6"]a simple question:error lnk2019 unresolved external symbol[/SIZE]



weixj2003ld
10th April 2009, 15:45
I define a class A as follows:


class A
{
protected:
void contentsMousePressEvent (QMouseEvent *e);
signals:
void extractClicked();
}
void A::contentsMousePressEvent (QMouseEvent *e)
{
.....
emit extractClicked();
}


when compile,error:error LNK2019: unresolved external symbol ...
means that can not find the function extractClicked.
Why?

Sheng
10th April 2009, 18:07
I define a class A as follows:


class A
{
protected:
void contentsMousePressEvent (QMouseEvent *e);
signals:
void extractClicked();
}
void A::contentsMousePressEvent (QMouseEvent *e)
{
.....
emit extractClicked();
}



when compile,error:error LNK2019: unresolved external symbol ...
means that can not find the function extractClicked.
Why?

Try this:


class A:public QWidget
{
Q_OBJECT

protected:
void contentsMousePressEvent (QMouseEvent *e);
signals:
void extractClicked();
}