Hi
I have these files in my project:
/home/myproj/lib/myPlugin.h
class MYPROJ_EXPORT myPlugin
: public QObject{
Q_OBJECT
public:
virtual ~myPlugin();
virtual myPlugin * newInstance() const = 0;
virtual qreal speed() const;
virtual qreal direction() const;
protected:
myPlugin();
private:
Q_DISABLE_COPY( myPlugin )
};
}
class MYPROJ_EXPORT myPlugin : public QObject
{
Q_OBJECT
public:
virtual ~myPlugin();
virtual myPlugin * newInstance() const = 0;
virtual qreal speed() const;
virtual qreal direction() const;
protected:
myPlugin();
private:
Q_DISABLE_COPY( myPlugin )
};
}
To copy to clipboard, switch view to plain text mode
/home/myproj/lib/myPlugin.cpp
#include "PositionProviderPlugin.h"
myProj::myPlugin::myPlugin()
{
}
myProj::myPlugin::~myPlugin()
{
}
qreal myProj::myPlugin::speed()
{
}
qreal myProj::myPlugin::direction()
{
}
#include "myPlugin.moc"
#include "PositionProviderPlugin.h"
myProj::myPlugin::myPlugin()
{
}
myProj::myPlugin::~myPlugin()
{
}
qreal myProj::myPlugin::speed()
{
}
qreal myProj::myPlugin::direction()
{
}
#include "myPlugin.moc"
To copy to clipboard, switch view to plain text mode
When I compile I get this error:
error: prototype for ‘qreal myProj::myPlugin::speed()’ does not match any in class ‘myProj::PositionProviderPlugin’
error: candidate is: virtual qreal myProj::myPlugin::speed() const
error: prototype for ‘qreal myProj::myPlugin::direction()’ does not match any in class ‘my::PositionProviderPlugin’
error: candidate is: virtual qreal myProj::myPlugin::direction() const
How can I correct this ?
Bookmarks