Проверив посты с похожими ошибками. Ни одно из предложенных решений не помогло преодолеть эту проблему.
Я проверил все мои классы на наличие ';' в конце определения ..... все они определены правильно.
Я проверил файл заголовков включения для защиты заголовков. Все они имеют охрану
Это результат построения проекта QT (приложение GUI для рабочего стола).
Каковы типичные причины этих ошибок, помимо упомянутых выше?
ниже выводится ошибка:
include \ ConfigServer.h (85 ): ошибка C2236: неожиданный токен struct. Вы забыли ';'?
include \ ConfigServer.h (85): ошибка C2332: 'struct': отсутствует имя тега
Этот файл ConfigServer.h включает 'BlockParam.h', 'CommsInfo.h' и 'GeoInfo.h', которые я ранее скомпилировал в отдельном консольном проекте, чтобы проверить их использование. Они работают над консольной программой.
Есть идеи?
#ifndef CONFIGSERVER_H
#define CONFIGSERVER_H
#include <iostream>
#include <iterator>
#include <QObject>
#include <QMap>
#include <QString>
#include <QVector>
#include <QFile>
#include <QXmlStreamReader>
#include <QDebug>
#include "BlockParam.h"
#include "CommsInfo.h"
#include "GeoInfo.h"
#define _delete(x) { if(x) delete x; x = nullptr;}
#define DEBUG 1
#define SHOW(X,B) { if(DEBUG) { std::cout << X << B <<std::endl ; } }
#define DISPLAY(X) { if(DEBUG) { std::cout << X <<std::endl ; } }
enum ENUM_PLATFORM {
NOTSET = 0,
SILSIM = 1, // Desktop Platform
PILSIM = 2, // PIL Platform
HILSIM = 3 // HIL Platform
};
enum ENUM_CONFIG
{
GEOINFO = 1,
COMMS = 2,
MDLPARAM = 3
};
typedef QMap<QString,ConfigInfo*> CfgMap;
class ConfigServer
{
public:
ConfigServer();
~ConfigServer();
bool LoadXmlFile(const QString xmlParmFileName);
bool Validate(Xpci* xpc);
bool IsValidated();
bool errorsOccurred();
QVector<QString> getErrorStrings();
template<class T>
ConfigInfo *GetConfigInfo(QString _inface,QString _pty,bool ebl);
template<class T>
void DisplayContent(T* Cfg) const;
CfgMap *getMap() const;
QVector<CfgMap> *getConfigList() const;
ENUM_PLATFORM PLATFORM;
ENUM_CONFIG CONFIGURATION;
QVector<QString> ErrStringsVector;
private:
void readModelXmlToMap(QXmlStreamReader* reader,CfgMap* ConfigMap_);
template<class T>
bool readCurrentInterfaceElement(QXmlStreamReader* reader,CfgMap* ConfigMap_);
template<class T>
bool readCurrentPropertyElement(QXmlStreamReader* reader,QString interface,CfgMap* ConfigMap_);
bool readCurrentDimensionElement(QXmlStreamReader* reader,unsigned &rowDim,unsigned &colDim);
BlockParam nullBlockParam;
CommsInfo nullCommsInfo;
GeoInfo nullGeoInfo;
CfgMap* ConfigMap = nullptr;
QVector<CfgMap> *ConfigList = nullptr;
unsigned requisite;
bool validated = false;
bool errorFlag = false;
};
template<> bool ConfigServer::readCurrentInterfaceElement<BlockParam>(QXmlStreamReader* reader,CfgMap* ConfigMap_) ;
template<> bool ConfigServer::readCurrentInterfaceElement<CommsInfo>(QXmlStreamReader* reader,CfgMap* ConfigMap_) ;
template<> bool ConfigServer::readCurrentInterfaceElement<GeoInfo>(QXmlStreamReader* reader,CfgMap* ConfigMap_) ;
template<> bool ConfigServer::readCurrentPropertyElement<BlockParam>(QXmlStreamReader *reader,QString interface,CfgMap* ConfigMap_);
template<> bool ConfigServer::readCurrentPropertyElement<CommsInfo>(QXmlStreamReader *reader,QString interface,CfgMap* ConfigMap_);
template<> bool ConfigServer::readCurrentPropertyElement<GeoInfo>(QXmlStreamReader *reader,QString interface,CfgMap* ConfigMap_);
template<> ConfigInfo *ConfigServer::GetConfigInfo<BlockParam>(QString _inface,QString _pty,bool ebl);
template<> ConfigInfo *ConfigServer::GetConfigInfo<CommsInfo>(QString _inface,QString _pty,bool ebl);
template<> ConfigInfo *ConfigServer::GetConfigInfo<GeoInfo>(QString _inface,QString _pty,bool ebl);
template<> void ConfigServer::DisplayContent<BlockParam>(BlockParam* Cfg) const;
template<> void ConfigServer::DisplayContent<CommsInfo>(CommsInfo* Cfg) const;
template<> void ConfigServer::DisplayContent<GeoInfo>(GeoInfo* Cfg) const;
#endif // CONFIGSERVER_H