mercredi 29 janvier 2020

C2236 : unexpected token 'struct', did you forget ';' ? C2332 : 'struct' missing a tag name

Having checked posts with similar errors. None of the solutions proposed helped overcoming this issue.

I have checked all my classes for ';' at the end of the definition.....all of them are properly defined.

I have checked the include headers file for header guards. All of them have guards

This is output of building a QT project (desktop GUI app) .

What are the typical causes of these errors aside from what's mentioned above ?

below is the output of the error :

include\ConfigServer.h(85): error C2236: unexpected token 'struct'. Did you forget a ';'?

include\ConfigServer.h(85): error C2332: 'struct': missing tag name

This 'ConfigServer.h' file include 'BlockParam.h' , 'CommsInfo.h' and 'GeoInfo.h' which I have compiled with previously on a separate console project to test their use. They work on a console program.

Any insight ?

#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, // Terrain/Airport/Runway Information
    COMMS    = 2, // IP/Port data for select platforms
    MDLPARAM = 3  // Model parameters
};


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

Aucun commentaire:

Enregistrer un commentaire