Hi all,
So, I'm busy with this pretty large project and I've come across a strange error today.
The code I'm working on is seperated over about 20 different files, and it used to compile with some warnings (The code is not completely finished yet) but this very file that produces this error used to compile fine without any errors or warnings.
Yet somehow it suddenly produces errors like this:
In file included from ../Qt/4.4.3/include/QtCore/qnamespace.h:1,
from ../Qt/4.4.3/include/QtCore/../../src/corelib/kernel/qobjec
tdefs.h:41,
from ../Qt/4.4.3/include/QtCore/qobjectdefs.h:1,
from ../Qt/4.4.3/include/QtCore/../../src/corelib/kernel/qobjec
t.h:43,
from ../Qt/4.4.3/include/QtCore/qobject.h:1,
from ..
/Qt
/4.4.3
/include
/QtCore
/QObject:1,
from ReferenceStructureForm.h:2:
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:50: error: synt
ax error before "namespace"
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:54: error: synt
ax error before '{' token
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:121: warning: r
eturn type defaults to `int'
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h: In function `Q
_DECLARE_FLAGS':
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: `Qt
' undeclared (first use in this function)
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: (Ea
ch undeclared identifier is reported only once
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: for
each function it appears in.)
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: confused b
y earlier errors, bailing out
mingw32-make[1]: *** [release/ReferenceStructureForm.o] Error 1
mingw32-make[1]: Leaving directory `C:/TMP'
mingw32-make: *** [release] Error 2
In file included from ../Qt/4.4.3/include/QtCore/qnamespace.h:1,
from ../Qt/4.4.3/include/QtCore/../../src/corelib/kernel/qobjec
tdefs.h:41,
from ../Qt/4.4.3/include/QtCore/qobjectdefs.h:1,
from ../Qt/4.4.3/include/QtCore/../../src/corelib/kernel/qobjec
t.h:43,
from ../Qt/4.4.3/include/QtCore/qobject.h:1,
from ../Qt/4.4.3/include/QtCore/QObject:1,
from ReferenceStructureForm.h:2:
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:50: error: synt
ax error before "namespace"
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:54: error: synt
ax error before '{' token
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:121: warning: r
eturn type defaults to `int'
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h: In function `Q
_DECLARE_FLAGS':
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: `Qt
' undeclared (first use in this function)
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: (Ea
ch undeclared identifier is reported only once
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: for
each function it appears in.)
../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: confused b
y earlier errors, bailing out
mingw32-make[1]: *** [release/ReferenceStructureForm.o] Error 1
mingw32-make[1]: Leaving directory `C:/TMP'
mingw32-make: *** [release] Error 2
To copy to clipboard, switch view to plain text mode
The code that I'm trying to compile goes like this:
Header file:
#include <QObject>
#ifndef ReferenceStructureFormH
#define ReferenceStructureFormH
class QFormReferenceStructure
: public QObject{
Q_OBJECT
public:
QFormReferenceStructure(QViewerList *parent = 0);
bool DoShowReferenceStructureFile
(QString);
};
#endif
#include <QObject>
#ifndef ReferenceStructureFormH
#define ReferenceStructureFormH
class QFormReferenceStructure : public QObject
{
Q_OBJECT
public:
QFormReferenceStructure(QViewerList *parent = 0);
bool DoShowReferenceStructureFile(QString);
};
#endif
To copy to clipboard, switch view to plain text mode
And the .cpp file:
#include "ReferenceStructureForm.h"
QFormReferenceStructure::QFormReferenceStructure(QViewerList *parent)
{
}
bool QFormReferenceStructure
::DoShowReferenceStructureFile(QString FileName
) {
return true;
}
#include "ReferenceStructureForm.h"
QFormReferenceStructure::QFormReferenceStructure(QViewerList *parent)
:QObject(parent)
{
}
bool QFormReferenceStructure::DoShowReferenceStructureFile(QString FileName)
{
return true;
}
To copy to clipboard, switch view to plain text mode
The functions aren't realy doing anything yet, this was just for testing.
There are some threads about similar errors on the QTForum, but for answers they provided links to threads that no longer seem to exist.
Can anyone help me?
Thanks in advance!
Bookmarks