QPlace
2nd November 2008, 14:56
I am using Qt4.5 technology preview with VS2008 and I am having problem building a test plugin:
1>pltest.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall MyClearing::metaObject(void)const " (?metaObject@MyClearing@@UBEPBUQMetaObject@@XZ)
1>pltest.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall MyClearing::qt_metacast(char const *)" (?qt_metacast@MyClearing@@UAEPAXPBD@Z)
1>pltest.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall MyClearing::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@MyClearing@@UAEHW4Call@QMetaObject@@ HPAPAX@Z)
This plugin has following code:
test.h file
class Clearing
{
public:
virtual ~Clearing(){};
virtual int Count () = 0;
};
Q_DECLARE_INTERFACE(Clearing,
"TestPlugin.1");
pltest.cpp file
#include <QObject>
#include <QtPlugin>
#include "test.h"
class MyClearing : public QObject, public Clearing
{
Q_OBJECT
Q_INTERFACES(Clearing)
public:
int Count () {return 1;}
};
Q_EXPORT_PLUGIN2(PLTest, MyClearing)
Linker options:
/OUT:"<pathtoproject>\PLTest.dll" /NOLOGO /LIBPATH:"<pathtoQT45\lib" /DLL /MANIFEST /MANIFESTFILE:"Debug\PLTest.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"<pathtoproject>\Debug\PLTest.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /ERRORREPORT:PROMPT qtmaind.lib QtGuid4.lib QtCored4.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
1>pltest.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall MyClearing::metaObject(void)const " (?metaObject@MyClearing@@UBEPBUQMetaObject@@XZ)
1>pltest.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall MyClearing::qt_metacast(char const *)" (?qt_metacast@MyClearing@@UAEPAXPBD@Z)
1>pltest.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall MyClearing::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@MyClearing@@UAEHW4Call@QMetaObject@@ HPAPAX@Z)
This plugin has following code:
test.h file
class Clearing
{
public:
virtual ~Clearing(){};
virtual int Count () = 0;
};
Q_DECLARE_INTERFACE(Clearing,
"TestPlugin.1");
pltest.cpp file
#include <QObject>
#include <QtPlugin>
#include "test.h"
class MyClearing : public QObject, public Clearing
{
Q_OBJECT
Q_INTERFACES(Clearing)
public:
int Count () {return 1;}
};
Q_EXPORT_PLUGIN2(PLTest, MyClearing)
Linker options:
/OUT:"<pathtoproject>\PLTest.dll" /NOLOGO /LIBPATH:"<pathtoQT45\lib" /DLL /MANIFEST /MANIFESTFILE:"Debug\PLTest.dll.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"<pathtoproject>\Debug\PLTest.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /ERRORREPORT:PROMPT qtmaind.lib QtGuid4.lib QtCored4.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib