PDA

View Full Version : unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMe



jiapei100
29th June 2010, 10:30
Hi, all:

Environments:
WindowsXP
Visual Studio 2008
Qt 4.6.3
qwt-5.2.1


My program used qwt, but I always obtain the following error messages:

error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" (?staticMetaObject@QwtPlot@@2UQMetaObject@@B)

I definitely linked the released version library qwt5.lib, and the corresponding qwt5.dll is under path.
(Note, I didn't link the debug version qwt5d.lib, by the way, how to produce the debug version under Windows? The default qwt compilation and building just produce the released version. )

Also, I noticed the post at
http://www.archivum.info/qt-interest@trolltech.com/2007-08/00243/Re:-LNK2001:-unresolved-external-symbol-quot-public:-static-struct-QMetaObject--const-QwtPlot::staticMetaObject-quot.html

It says that

It turns out the slowest way is the fast way. Problem solved!!! That is in C/C++ compiler | PreProcessor | PreProcessor Definition, which I should have, but I forget a keyword: “QWT_DLL”. With this keyword, the link error is gone!

However, this doesn't work for me. sad...:(
Can anybody give me a hand?

Cheers
JIA

jiapei100
30th June 2010, 08:31
Problem solved.
Have to define the preprocessor "QWT_DLL" from the very lowest library that calls qwt.

Cheers

DavidCasper
18th June 2013, 17:46
Thanks. This really helped me too.

MattPhillips
5th March 2014, 01:13
Thanks jiapei100, you saved me a lot of time with your answer!

sampad1370
9th May 2016, 12:30
hi
I also use QwtPolar so I add QWT_POLAR_DLL to my project so solve another unresolve external symbol...
thanks of all body.

Goodluck
A.A