PDA

View Full Version : problem with interface Class - Error:undefined interface



k.qasempour
11th August 2012, 12:43
im trying to test a plugin based application... so as u know i have an interface and then a plug-in which manipulate the interface... i think everything is OK but i face with this error>>
( error: Undefined interface)
. here is my code... how knows wahts the problem

//// pro file
#-------------------------------------------------
#
# Project created by QtCreator 2012-08-11T13:34:07
#
#-------------------------------------------------

QT += core

QT -= gui

TARGET = CAlPlugin_Based
CONFIG += console
CONFIG -= app_bundle



TEMPLATE = app


SOURCES += main.cpp

HEADERS += \
EvaluateInterface.h\
Evaluate.h

//// Evaluate.h file
#ifndef EVALUATE_H
#define EVALUATE_H

#include<EvaluateInterface.h>

class evaluate : public evaluateInterface
{
Q_OBJECT
Q_INTERFACES(evaluateInterface)

public:
QString name1() const;
int evaluate1(int num1, int num2) const;
};

#endif // EVALUATE_H


//// EvaluateInterface.h

#ifndef EVALUATEINTERFACE_H
#define EVALUATEINTERFACE_H



class evaluateInterface
{
public:
virtual ~evaluateInterface(){}

virtual QString name1() const=0;
virtual int evaluate1(int num1,int num2) const=0;
};
Q_DECLARE_INTERFACE(evaluateInterface,"CaaaalInter face/1.0")

#endif // EVALUATEINTERFACE_H



Whats the problem then... thank u alll

Zlatomir
11th August 2012, 13:11
It might be the space in there: "CaaaalInter face/1.0", but i'm not sure about that, and please don't post the same question in many sub-forums.

k.qasempour
11th August 2012, 14:03
no space is there... ok

amleto
11th August 2012, 16:07
if you use code tags it will be easier for everyone to read.

d_stranz
12th August 2012, 02:11
Class "evaluate" declares Q_OBJECT but is not derived from QObject.