johnmauer
30th January 2010, 23:54
I am building a static plugin for a Qt application and keep getting the following error message. I'm sure the error is obvious,but I haven't been able to find it. The interface and code are mimics of the example plugin just to test the build. Thanks for any help.
Error 1 error LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_juryplugin(void)" (?qt_plugin_instance_juryplugin@@YAPAVQObject@@XZ) referenced in function "public: __thiscall StaticjurypluginPluginInstance::StaticjurypluginPl uginInstance(void)" (??0StaticjurypluginPluginInstance@@QAE@XZ) main.obj Statfit3
#ifndef JURYINTERFACE_H
#define JURYINTERFACE_H
#include <QString>
class JuryInterface
{
public:
virtual ~JuryInterface() {}
virtual QString echo(const QString &message) = 0;
};
Q_DECLARE_INTERFACE(JuryInterface,
"com.geerms.JuryPlugin.JuryInterface/1.0");
#endif
#ifndef JURYPLUGIN_H
#define JURYPLUGIN_H
#include <QtCore>
#include "juryinterface.h"
class JuryPlugin : public QObject,
public JuryInterface
{
Q_OBJECT
Q_INTERFACES(JuryInterface)
public:
QString echo(const QString &message);
};
#endif // JURYPLUGIN_H
#include "juryplugin.h"
QString JuryPlugin::echo(const QString &message)
{
return message;
}
Q_EXPORT_PLUGIN2(juryplugin, JuryPlugin);
the main.cpp has
Q_IMPORT_PLUGIN(juryplugin);
Error 1 error LNK2019: unresolved external symbol "class QObject * __cdecl qt_plugin_instance_juryplugin(void)" (?qt_plugin_instance_juryplugin@@YAPAVQObject@@XZ) referenced in function "public: __thiscall StaticjurypluginPluginInstance::StaticjurypluginPl uginInstance(void)" (??0StaticjurypluginPluginInstance@@QAE@XZ) main.obj Statfit3
#ifndef JURYINTERFACE_H
#define JURYINTERFACE_H
#include <QString>
class JuryInterface
{
public:
virtual ~JuryInterface() {}
virtual QString echo(const QString &message) = 0;
};
Q_DECLARE_INTERFACE(JuryInterface,
"com.geerms.JuryPlugin.JuryInterface/1.0");
#endif
#ifndef JURYPLUGIN_H
#define JURYPLUGIN_H
#include <QtCore>
#include "juryinterface.h"
class JuryPlugin : public QObject,
public JuryInterface
{
Q_OBJECT
Q_INTERFACES(JuryInterface)
public:
QString echo(const QString &message);
};
#endif // JURYPLUGIN_H
#include "juryplugin.h"
QString JuryPlugin::echo(const QString &message)
{
return message;
}
Q_EXPORT_PLUGIN2(juryplugin, JuryPlugin);
the main.cpp has
Q_IMPORT_PLUGIN(juryplugin);