tranfuga25s
6th March 2008, 15:27
when I try to compile my plugin, I get this error:
compilando presupuesto.cpp (g++)
presupuesto.h:45: error: ISO C++ forbids declaration of 'EPresupuesto' with no type
presupuesto.h:45: error: expected ';' before '*' token
presupuesto.cpp: In constructor 'Presupuesto::Presupuesto(QObject*)':
presupuesto.cpp:65: error: '_plugin' was not declared in this scope
presupuesto.cpp:65: error: 'EPresupuesto' was not declared in this scope
presupuesto.cpp:65: error: parse error in template argument list
presupuesto.cpp:65: error: no matching function for call to 'qobject_cast(QObject*)'
but the code is the next:
if( loader->load() )
{
_plugin = qobject_cast<EPresupuesto *>(loader->instance());and in the class is declared as follows:
private:
EPresupuesto *_plugin;the include is present and the interface is
#include <QtPlugin>
class QString;
class QSqlRecord;
/**
* \brief Interfaz de presupuesto
*
* Interfaz para especificaciones del plugin presupuesto
*
* @author Esteban Zeller <juiraze@yahoo.com.ar>
*/
class EPresupuesto
{
public:
virtual ~EPresupuesto() {}
virtual QString nombre() const = 0;
virtual double version() const = 0;
virtual void setRegistro( QSqlRecord *rec ) = 0;
virtual QString obtenerHtml() = 0;
virtual QString obtenerContenido() = 0;
};
Q_DECLARE_INTERFACE(EPresupuesto,
"tranfuga.EPresupuesto/1.0" )Where is the problem??? :(
thanks in advance
compilando presupuesto.cpp (g++)
presupuesto.h:45: error: ISO C++ forbids declaration of 'EPresupuesto' with no type
presupuesto.h:45: error: expected ';' before '*' token
presupuesto.cpp: In constructor 'Presupuesto::Presupuesto(QObject*)':
presupuesto.cpp:65: error: '_plugin' was not declared in this scope
presupuesto.cpp:65: error: 'EPresupuesto' was not declared in this scope
presupuesto.cpp:65: error: parse error in template argument list
presupuesto.cpp:65: error: no matching function for call to 'qobject_cast(QObject*)'
but the code is the next:
if( loader->load() )
{
_plugin = qobject_cast<EPresupuesto *>(loader->instance());and in the class is declared as follows:
private:
EPresupuesto *_plugin;the include is present and the interface is
#include <QtPlugin>
class QString;
class QSqlRecord;
/**
* \brief Interfaz de presupuesto
*
* Interfaz para especificaciones del plugin presupuesto
*
* @author Esteban Zeller <juiraze@yahoo.com.ar>
*/
class EPresupuesto
{
public:
virtual ~EPresupuesto() {}
virtual QString nombre() const = 0;
virtual double version() const = 0;
virtual void setRegistro( QSqlRecord *rec ) = 0;
virtual QString obtenerHtml() = 0;
virtual QString obtenerContenido() = 0;
};
Q_DECLARE_INTERFACE(EPresupuesto,
"tranfuga.EPresupuesto/1.0" )Where is the problem??? :(
thanks in advance