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:

Qt Code:
  1. In file included from ../Qt/4.4.3/include/QtCore/qnamespace.h:1,
  2. from ../Qt/4.4.3/include/QtCore/../../src/corelib/kernel/qobjec
  3. tdefs.h:41,
  4. from ../Qt/4.4.3/include/QtCore/qobjectdefs.h:1,
  5. from ../Qt/4.4.3/include/QtCore/../../src/corelib/kernel/qobjec
  6. t.h:43,
  7. from ../Qt/4.4.3/include/QtCore/qobject.h:1,
  8. from ../Qt/4.4.3/include/QtCore/QObject:1,
  9. from ReferenceStructureForm.h:2:
  10. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:50: error: synt
  11. ax error before "namespace"
  12. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:54: error: synt
  13. ax error before '{' token
  14. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:121: warning: r
  15. eturn type defaults to `int'
  16. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h: In function `Q
  17. _DECLARE_FLAGS':
  18. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: `Qt
  19. ' undeclared (first use in this function)
  20. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: (Ea
  21. ch undeclared identifier is reported only once
  22. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: for
  23. each function it appears in.)
  24. ../Qt/4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: confused b
  25. y earlier errors, bailing out
  26. mingw32-make[1]: *** [release/ReferenceStructureForm.o] Error 1
  27. mingw32-make[1]: Leaving directory `C:/TMP'
  28. 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:
Qt Code:
  1. #include <QObject>
  2.  
  3. #ifndef ReferenceStructureFormH
  4. #define ReferenceStructureFormH
  5.  
  6. class QFormReferenceStructure : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. QFormReferenceStructure(QViewerList *parent = 0);
  11. bool DoShowReferenceStructureFile(QString);
  12.  
  13.  
  14. };
  15.  
  16. #endif
To copy to clipboard, switch view to plain text mode 

And the .cpp file:

Qt Code:
  1. #include "ReferenceStructureForm.h"
  2.  
  3. QFormReferenceStructure::QFormReferenceStructure(QViewerList *parent)
  4. :QObject(parent)
  5. {
  6. }
  7.  
  8. bool QFormReferenceStructure::DoShowReferenceStructureFile(QString FileName)
  9. {
  10. return true;
  11. }
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!