I'm trying added such class to a project^
//Emitter.h
#ifndef EMITTER_H
#define EMITTER_H
#include <QObject>
#include <QDBusInterface>
#include <QDBusAbstractAdaptor>
#include <QDBusVariant>
class Emitter:public QObject
{
Q_OBJECT
public:
Emitter();
private:
QDBusInterface * m_interface;
QString m_interfaceName;
};
#endif // EMITTER_H
and
//Emitter.cpp
#include "CESMEmitter.moc"
#include "Emitter.h"
Emitter::Emitter( QObject * parent )
: QObject( parent )
{
}
CESMEmitter.moc file I received by using moc like this:
moc CESMEmitter.h > CESMEmitter.moc
After trying to build with Makefile I received an error, sayng that Qt include files were not found.
So I added variable
QT_STUFF = -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDBus -I/usr/include/qt4 -L/usr/lib/x86_64-linux-gnu -lQtGui -lQtCore -lQtDBus -lpthread
And applied it.
The include files were found, but other errors arised:
error: undefined reference to `QObject::QObject(QObject*)'
error: undefined reference to `qt_assert(char const*, char const*, int)'
error: undefined reference to `QString::shared_null'
error: undefined reference to `QString::shared_null'
Can anyone please advise?