DrDonut
20th May 2009, 15:35
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
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
And the .cpp file:
#include "ReferenceStructureForm.h"
QFormReferenceStructure::QFormReferenceStructure(Q ViewerList *parent)
:QObject(parent)
{
}
bool QFormReferenceStructure::DoShowReferenceStructureF ile(QString FileName)
{
return true;
}
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!
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
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
And the .cpp file:
#include "ReferenceStructureForm.h"
QFormReferenceStructure::QFormReferenceStructure(Q ViewerList *parent)
:QObject(parent)
{
}
bool QFormReferenceStructure::DoShowReferenceStructureF ile(QString FileName)
{
return true;
}
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!