I am using Qt Creator to work on a project. Qt Creator is v3.1.2 based on Qt 5.3.1 (MSVC 2010, 32bit). After getting a significant part of the application coded and tested I was adding a couple of new modules. I started getting errors in Qt code!!! I have no idea what is causing it.

So I decided to start a new project and add the old code one module at a time. I have a global header file that I use to define various structures that are passed between modules. I have not changed this module at all. It has been working fine up to this point.

Here is the module:

Qt Code:
  1. #ifndef GLOBAL_H
  2. #define GLOBAL_H
  3.  
  4. #include <QString>
  5.  
  6. struct _RoadsData {
  7. QString state;
  8. QString cnty;
  9. QString name;
  10. QString mtfcc;
  11. QString rttype;
  12. int roadtype;
  13. QString geometry;
  14. };
  15.  
  16. struct _ContourData {
  17. QString state;
  18. QString cnty;
  19. int type;
  20. QString geometry;
  21. };
  22.  
  23. struct _ImperviousData {
  24. QString state;
  25. QString cnty;
  26. int type;
  27. QString geometry;
  28. };
  29.  
  30. struct _AreaObjectsData {
  31. QString state;
  32. QString cnty;
  33. int type;
  34. QString name;
  35. QString geometry;
  36. };
  37.  
  38. struct _ParcelData {
  39. QString state;
  40. QString cnty;
  41. QString address;
  42. QString geometry;
  43. };
  44.  
  45. struct _PointObjectsData {
  46. QString state;
  47. QString cnty;
  48. int type;
  49. QString name;
  50. QString geometry;
  51. };
  52.  
  53. struct _AddrPointData {
  54. QString state;
  55. QString cnty;
  56. int stnbr;
  57. QString geometry;
  58. };
  59.  
  60.  
  61. Q_DECLARE_METATYPE(_RoadsData)
  62. Q_DECLARE_METATYPE(_ContourData)
  63. Q_DECLARE_METATYPE(_ParcelData)
  64. Q_DECLARE_METATYPE(_AddrPointData)
  65. Q_DECLARE_METATYPE(_ImperviousData)
  66. Q_DECLARE_METATYPE(_AreaObjectsData)
  67. Q_DECLARE_METATYPE(_PointObjectsData)
  68. #endif // GLOBAL_H
To copy to clipboard, switch view to plain text mode 
The project builds clean if I haven't yet used this file. As soon as I include it in a module I get the following error for each of the declares:

C3646: 'Q_DECLARE_METATYPE' : unknown override specifier
I also get
C2091: function returns function
in global.h

Also I get a bunch of errors in iterator and xfunctional.

In searching this error I found a suggestion that I put in an include for QMetaType. (It worked fine before this without that include.) I put it in. The errors went away in global.h. But now I'm getting errors in iterator, qlist.h, qscopedpointer.h and qobject_impl.h.

I don't know what to do!!! Please help.