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:
#ifndef GLOBAL_H
#define GLOBAL_H
#include <QString>
struct _RoadsData {
int roadtype;
};
struct _ContourData {
int type;
};
struct _ImperviousData {
int type;
};
struct _AreaObjectsData {
int type;
};
struct _ParcelData {
};
struct _PointObjectsData {
int type;
};
struct _AddrPointData {
int stnbr;
};
Q_DECLARE_METATYPE(_RoadsData)
Q_DECLARE_METATYPE(_ContourData)
Q_DECLARE_METATYPE(_ParcelData)
Q_DECLARE_METATYPE(_AddrPointData)
Q_DECLARE_METATYPE(_ImperviousData)
Q_DECLARE_METATYPE(_AreaObjectsData)
Q_DECLARE_METATYPE(_PointObjectsData)
#endif // GLOBAL_H
#ifndef GLOBAL_H
#define GLOBAL_H
#include <QString>
struct _RoadsData {
QString state;
QString cnty;
QString name;
QString mtfcc;
QString rttype;
int roadtype;
QString geometry;
};
struct _ContourData {
QString state;
QString cnty;
int type;
QString geometry;
};
struct _ImperviousData {
QString state;
QString cnty;
int type;
QString geometry;
};
struct _AreaObjectsData {
QString state;
QString cnty;
int type;
QString name;
QString geometry;
};
struct _ParcelData {
QString state;
QString cnty;
QString address;
QString geometry;
};
struct _PointObjectsData {
QString state;
QString cnty;
int type;
QString name;
QString geometry;
};
struct _AddrPointData {
QString state;
QString cnty;
int stnbr;
QString geometry;
};
Q_DECLARE_METATYPE(_RoadsData)
Q_DECLARE_METATYPE(_ContourData)
Q_DECLARE_METATYPE(_ParcelData)
Q_DECLARE_METATYPE(_AddrPointData)
Q_DECLARE_METATYPE(_ImperviousData)
Q_DECLARE_METATYPE(_AreaObjectsData)
Q_DECLARE_METATYPE(_PointObjectsData)
#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.
Bookmarks