#error "The header file 'xqtelephony.h' doesn't include <QObject>."
Hello friends...
while building my application I am getting an error like:
[QUOTE]C:\QtProjects\Events\moc\moc_xqtelephony.cpp:12: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
ERROR: cpp.EXE failure[/QUOTE]
In my Windows XP machine, it's running fine, how ever on my Windows 7 machine I got this kind of error.
I am using "Mobile_extensions_preview_3" for my telephony usage.
Any Idea how to remove this error.
Thanks...
Re: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
And how does line 12 of moc_xqtelephony.cpp looks like?
Re: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
[QUOTE=divanov;771894]And how does line 12 of moc_xqtelephony.cpp looks like?[/QUOTE]
The moc_xqtelephony.cpp file contents are:
[QUOTE]/****************************************************************************
** Meta object code from reading C++ file 'xqtelephony.h'
**
** Created: Wed Sep 1 15:18:10 2010
** by: The Qt Meta Object Compiler version 62 (Qt 4.6.3)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../xqtelephony.h"
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'xqtelephony.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 62
#error "This file was generated using the moc from 4.6.3. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
static const uint qt_meta_data_XQTelephony[] = {
// content:
4, // revision
0, // classname
0, 0, // classinfo
5, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
2, // signalCount
// signals: signature, parameters, type, tag, flags
27, 13, 12, 12, 0x05,
84, 78, 12, 12, 0x05,
// slots: signature, parameters, type, tag, flags
122, 110, 12, 12, 0x0a,
141, 12, 136, 12, 0x0a,
163, 12, 12, 12, 0x0a,
0 // eod
};
static const char qt_meta_stringdata_XQTelephony[] = {
"XQTelephony\0\0status,number\0"
"lineStatusChanged(XQTelephony::LineStatus,QString)\0"
"error\0error(XQTelephony::Error)\0"
"phoneNumber\0call(QString)\0bool\0"
"startMonitoringLine()\0stopMonitoringLine()\0"
};
const QMetaObject XQTelephony::staticMetaObject = {
{ &QObject::staticMetaObject, qt_meta_stringdata_XQTelephony,
qt_meta_data_XQTelephony, 0 }
};
#ifdef Q_NO_DATA_RELOCATION
const QMetaObject &XQTelephony::getStaticMetaObject() { return staticMetaObject; }
#endif //Q_NO_DATA_RELOCATION
const QMetaObject *XQTelephony::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
}
void *XQTelephony::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_XQTelephony))
return static_cast<void*>(const_cast< XQTelephony*>(this));
return QObject::qt_metacast(_clname);
}
int XQTelephony::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QObject::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
switch (_id) {
case 0: lineStatusChanged((*reinterpret_cast< XQTelephony::LineStatus(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break;
case 1: error((*reinterpret_cast< XQTelephony::Error(*)>(_a[1]))); break;
case 2: call((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 3: { bool _r = startMonitoringLine();
if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; } break;
case 4: stopMonitoringLine(); break;
default: ;
}
_id -= 5;
}
return _id;
}
// SIGNAL 0
void XQTelephony::lineStatusChanged(XQTelephony::LineStatus _t1, QString _t2)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)), const_cast<void*>(reinterpret_cast<const void*>(&_t2)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void XQTelephony::error(XQTelephony::Error _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}[/QUOTE]
QT_END_MOC_NAMESPACE
Re: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
I don't have sources, but it seems it wants #include <QObject> in the xqtelephony.h
Re: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
[QUOTE=divanov;771920]I don't have sources, but it seems it wants #include <QObject> in the xqtelephony.h[/QUOTE]
divanov, the file has #include <QObject>
please check the contents:
[QUOTE]#ifndef XQTELEPHONY_H
#define XQTELEPHONY_H
// INCLUDES
#include <QObject>
#include "telephony_global.h"
// FORWARD DECLARATIONS
class XQTelephonyPrivate;
// CLASS DECLARATION
class XQTELEPHONY_EXPORT XQTelephony : public QObject
{
Q_OBJECT
public:
enum Error {
NoError = 0,
OutOfMemoryError,
UnknownError = -1
};
enum LineStatus {
StatusUnknown,
StatusIdle,
StatusDialling,
StatusRinging,
StatusAnswering,
StatusConnecting,
StatusConnected,
StatusReconnectPending,
StatusDisconnecting,
StatusHold,
StatusTransferring,
StatusTransferAlerting
};
XQTelephony(QObject* parent = 0);
~XQTelephony();
XQTelephony::Error error() const;
public Q_SLOTS:
void call(const QString& phoneNumber);
bool startMonitoringLine();
void stopMonitoringLine();
Q_SIGNALS:
void lineStatusChanged(XQTelephony::LineStatus status, QString number);
void error(XQTelephony::Error error);
private:
friend class XQTelephonyPrivate;
XQTelephonyPrivate* d;
};
#endif // XQTELEPHONY_H
// End of file
[/QUOTE]
Re: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
Same question. I use N8 to run my program and moc as below. what's this suppose to mean?
#error "The header file 'clock.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 62
#error "This file was generated using the moc from 4.6.3. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
Re: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
Clearly, the version of QObject being included doesn't define Q_MOC_OUTPUT_REVISION. It may well be that QObject is erroring somehow in the include step, or that there's another define (or not) that's sending QObject down the wrong #ifdef path.
Re: #error "The header file 'xqtelephony.h' doesn't include <QObject>."
This error usually occurs when you try to compile the MOC-generated file as a regular source/header file. For example, having something like
[code]
SOURCES += *.cpp
HEADERS += *.h
[/code]
will easily lead in to such problems unless you have MOC_DIR pointing to some other directory.