Hello again,
As i worked out the out the code and used different qt versions,minGW and MSCV i got different results. However in some cases i managed to get qcadexample.dll file i got,
Plugin verification data mismatch in '.../plugins/qcadexample.dll' error on QCAD's about dialog.
Also plugin name, version, id are all unknown in that panel. I know the problem occurs from the below code in RExamplePlugin.cpp file,
RPluginInfo RExamplePlugin::getPluginInfo() {
RPluginInfo ret;
ret.set("Version", "1.0");
ret.set("ID", "EXAMPLE");
ret.set("Name", "Example Plugin");
ret.set("License", "GPLv3");
ret.set("URL", "
http://qcad.org");
return ret;
}
but i dont know why i can compile the files when i draw the above line in my code and why i cannot when i add them. I still got,
RExamplePlugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl RPluginInfo::RPluginInfo(void)" (__imp_??0RPluginInfo@@QEAA@XZ) referenced in function "public: virtual class RPluginInfo __cdecl RExamplePlugin::getPluginInfo(void)" (?getPluginInfo@RExamplePlugin@@UEAA?AVRPluginInfo@@XZ)
RExamplePlugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl RPluginInfo::set(class QString const &,class QVariant const &)" (__imp_?set@RPluginInfo@@QEAAXAEBVQString@@AEBVQVariant@@@Z) referenced in function "public: virtual class RPluginInfo __cdecl RExamplePlugin::getPluginInfo(void)" (?getPluginInfo@RExamplePlugin@@UEAA?AVRPluginInfo@@XZ)
RExamplePlugin.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl RPluginInfo::~RPluginInfo(void)" (__imp_??1RPluginInfo@@QEAA@XZ) referenced in function "int `public: virtual class RPluginInfo __cdecl RExamplePlugin::getPluginInfo(void)'::`1'::dtor$0" (?dtor$0@?0??getPluginInfo@RExamplePlugin@@UEAA?AVRPluginInfo@@XZ@4HA)
..\..\..\plugins\qcadexample.dll : fatal error LNK1120: 3 unresolved externals.
error. I wonder can someone verify that he can compile exampleplugin.pro file in support/examples/exampleplugin on windows by using qt creator 3.5.1 based on Qt 5.5.1 (MSVC 2013, 32 bit)? Im not sure if im skipping something or there is something wrong in the code? Im sorry for bothering you with my neewbie questions.
my files are,
exampleplugin.pro
CONFIG += plugin
TARGET = example
include(C:/qcad-master/shared.pri)
HEADERS = RExamplePlugin.h
SOURCES = RExamplePlugin.cpp
TEMPLATE = lib
DESTDIR = ../../../plugins
LIBS += C:/qcad-master/qcadcore.lib
LIBS += C:/qcad-master/qcadgui.lib
LIBS += C:/qcad-master/qcadecmaapi.lib
RExamplePlugin.h
#include <QObject>
#include <QScriptEngine>
#include "C:/qcad-master/src/core/RPluginInterface.h"
class RExamplePlugin : public QObject, public RPluginInterface
{
Q_OBJECT
Q_INTERFACES(RPluginInterface)
public:
virtual bool init() { return true; }
virtual void uninit(bool) {}
virtual void postInit(InitStatus) {}
virtual void initScriptExtensions(QScriptEngine) {}
virtual RPluginInfo getPluginInfo();
virtual bool checkLicense() { return true; }
};
RExamplePlugin.cpp
#include "RExamplePlugin.h"
RPluginInfo RExamplePlugin::getPluginInfo() {
RPluginInfo ret;
ret.set("Version", "1.0");
ret.set("ID", "EXAMPLE");
ret.set("Name", "Example Plugin");
ret.set("License", "GPLv3");
ret.set("URL", "
http://qcad.org");
return ret;
}
#if QT_VERSION < 0x050000
QT_BEGIN_NAMESPACE
Q_EXPORT_PLUGIN2(example, RExamplePlugin)
QT_END_NAMESPACE
#endif
Thank you.