2 Attachment(s)
Unresolved external symbol "staticMetaObject"
Hi Guys,
I'm build an application with VS2008+QT4.6.2 (configure it as static)
Steps:
configure -release -static -fast -qt-gif -qt-libjpeg -qt-sql-odbc -openssl-linked -qt-sql-sqlite -no-webkit -qt-zlib -no-dbus -no-phonon -nomake examples -nomake docs -nomake demos -nomake translations -platform win32-msvc2008
qmake -config release
nmake
However some linking errors are reported as below:
link /LIBPATH:"c:\Qt\lib" /NOLOGO /INCREMENTAL:NO /MANIFEST /MANIFESTFIL
E:"release\QtWeb.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:
type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKe
yToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:release\Q
tWeb.exe @C:\DOCUME~1\sr71\LOCALS~1\Temp\nm6B5.tmp
moc_history.obj : error LNK2001: unresolved external symbol "public: static stru
ct QMetaObject const QWebHistoryInterface::staticMetaObject" (?staticMetaObject@
QWebHistoryInterface@@2UQMetaObject@@B)
moc_webpage.obj : error LNK2001: unresolved external symbol "public: static stru
ct QMetaObject const QWebPage::staticMetaObject" (?staticMetaObject@QWebPage@@2U
QMetaObject@@B)
moc_webview.obj : error LNK2001: unresolved external symbol "public: static stru
ct QMetaObject const QWebView::staticMetaObject" (?staticMetaObject@QWebView@@2U
QMetaObject@@B)
The generated moc_history.cpp is attached.
Could someone give me a hand on this? Thanks a lot.
Cheers
Rick
Re: Unresolved external symbol "staticMetaObject"
maybe the "-no-webkit" option is too much here ?
Re: Unresolved external symbol "staticMetaObject"
Totem, I just used -no-webkit to speed up the build -- do you mean webkit should be build for dependency? Thanks.
Re: Unresolved external symbol "staticMetaObject"
sr71, I am also getting same linker error. My setup is VS2005 + Qt 4.6.2 (precompiled libs that Qt provides)
I don't think -no-webkit is an issue.
I found that if I remove Q_OBJECT from .h file the application compiles ok. Also I exported the project to .pro and compiling it in Qt Creator also works fine (this is with Q_OBJECT) in .h file. I don't think that removing Q_OBJECT is a solution to this issue. Anybody???
Re: Unresolved external symbol "staticMetaObject"
My post is here
http://www.qtcentre.org/threads/3202...tPlot-staticMe
Probably, I've got exactly the same problem as yours.
Did you solve this problem already? If so, please do give me a hand.
Thank you very much in advance.
Best Regards
JIA
Re: Unresolved external symbol "staticMetaObject"
Yes, after removing from my .h file, I can get my application compiled and built.
However, when I ran it, I confronted another issue "Seg fault on program start", as posted here:
http://www.osgeo.org/pipermail/qgis-...ch/006230.html
Well, may I ask:
1)
What is the purpose of after my class definition? For example, my class looks like:
Code:
{
Q_OBJECT
private:
....
};
What is used for?
2)
Without Q_OBJECT, I obtained this warning and the program won't start.
Quote:
Warning: QObject::connect: Connecting from COMPAT signal (QAction::activated())
With Q_OBJECT, I obtained the following error compilation message:
Quote:
error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" (?staticMetaObject@QwtPlot@@2UQMetaObject@@B)
3) My Environments:
WindowsXP+Visual Studio 2008+qt-vs-addin-1.1.5.exe+qwt-5.2.1
4)
In addition, under Ubuntu 10.04, the same program runs perfectly.
So, can anybody help please?
Best Regards
JIA