Hi --
I'm getting an error having to do with staticMetaObject that I don't
understand, snippet of the build output below. Can anyone shed light on
this problem?
I am building a plugin for QtCreator. (Two plugins, actually, but I don't
*think* that matters here.)
I have Q_OBJECT mentioned in the .h files in appropriate places, e.g.
class BARPLUGIN_EXPORT Bar: public SuperBar // SuperBar inherits from
QObject
{
Q_OBJECT
...
where BARPLUGIN_EXPORT is
#ifndef BARPLUGIN_EXPORT_H
#define BARPLUGIN_EXPORT_H
#include <QtCore/qglobal.h>
#if defined(BARPLUGIN_LIBRARY)
# define BARPLUGIN_EXPORT Q_DECL_EXPORT
#else
# define BARPLUGIN_EXPORT Q_DECL_IMPORT
#endif
#endif // BARPLUGIN_EXPORT_
Both the foo and bar plugins are listed in the qtcreator.pro file:
QTPLUGIN += barplugin foo4qtcreator
(Baz and Gorp are in the foo4qtcreator plugin, not the bar plugin. Only Bar
is in the bar plugin.)
The foo4qtcreator.pluginspec has barplugin on its dependency list:
<dependency name="barplugin"/>
The foo4qtcreator.pro file has both libraries listed:
DEFINES += FOO4QTCREATOR_LIBRARY
DEFINES += BARPLUGIN_LIBRARY
BarPlugIn and Foo4QtPlugin both inherit from ExtensionSystem::IPlugin.
Here is a snipped from the output of the linker. Note: I added line breaks
to help myself read the output. Baz and Gorp are both in the foo plugin.
cl -c -FIqtcreator_gui_pch.h -Yuqtcreator_gui_pch.h
-Fprelease\foo4qtcreator_pch.pch
-nologo -Zm200 -Zc:wchar_t- -O2 -MD -GR -EHsc -W3 -w34100 -w34189
-DUNICODE -DWIN32
-DQT_LARGEFILE_SUPPORT -DIDE_LIBRARY_BASENAME=\"lib\"
-DQT_NO_CAST_TO_ASCII
-DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION
-D_CRT_SECURE_NO_WARNINGS
-DFOO4QTCREATOR_LIBRARY -DTRACPLUGIN_LIBRARY -DQXT_GUI_LIB
-DQXT_NETWORK_LIB
-DQXT_CORE_LIB -DQT_DLL -DQT_NO_DEBUG -DQT_PLUGIN -DQT_TESTLIB_LIB
-DQT_XML_LIB
-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX
-DQT_HAVE_3DNOW -DQT_HAVE_SSE
-DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QtCore"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QtNetwork"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QtGui"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QtXml"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QtTest"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QxtCore"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QxtNetwork"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\QxtGui"
-I"..\..\libs"
-I"c:\work\Qt\dev3\qt-creator-2.2.1-src\tools"
-I"..\..\plugins"
-I"..\..\libs\3rdparty\botan\build"
-I"..\coreplugin"
-I"c:\Qxt\include"
-I"c:\Qxt\include\QxtGui"
-I"c:\Qxt\include\QxtNetwork"
-I"c:\Qxt\include\QxtCore"
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\include\ActiveQt"
-I"release"
-I"."
-I"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\mkspecs\default"
-Forelease\
@C:\Users\KSHERW~1\AppData\Local\Temp\nmC32D.tmp
fooplugin.cpp
link /LIBPATH:"c:\work\Qt\qt-everywhere-opensource-src-4.7.3\lib"
/NOLOGO /INCREMENTAL:NO /DLL
/MANIFEST
/MANIFESTFILE:"release\foo4qtcreator.intermediate.manifest"
/OUT:..\..\..\lib\qtcreator\plugins\Nokia\foo4qtcreator.dll
@C:\Users\KSHERW~1\AppData\Local\Temp\nmC8AA.tmp
Creating library ..\..\..\lib\qtcreator\plugins\Nokia\foo4qtcreator.lib
and object ..\..\..\lib\qtcreator\plugins\Nokia\foo4qtcreator.exp
moc_gorp.obj : error LNK2001: unresolved external symbol
"public: static struct QMetaObject const Bar::staticMetaObject"
(?staticMetaObject@Bar@@2UQMetaObject@@B)
fooplugin.obj : error LNK2019: unresolved external symbol
"public: static struct QMetaObject const Bar::staticMetaObject"
(?staticMetaObject@Bar@@2UQMetaObject@@B)
referenced in function
"public: static class QString __cdecl Bar::tr(char const *,char const
*)"
(?tr@Bar@@SA?AVQString@@PBD0@Z)
baz.obj : error LNK2001: unresolved external symbol
"public: static struct QMetaObject const Bar::staticMetaObject"
(?staticMetaObject@Bar@@2UQMetaObject@@B)
gorp.obj : error LNK2001: unresolved external symbol
"public: static struct QMetaObject const Bar::staticMetaObject"
(?staticMetaObject@Bar@@2UQMetaObject@@B)
moc_baz.obj : error LNK2001: unresolved external symbol
"public: static struct QMetaObject const Bar::staticMetaObject"
(?staticMetaObject@Bar@@2UQMetaObject@@B)
..\..\..\lib\qtcreator\plugins\Nokia\foo4qtcreator.dll : fatal error
LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\BIN\nmake.exe"' : return code '0x2'
--
Kaitlin Duck Sherwood
_______________________________________________
Qt-creator mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-creator