D
D
DancingOnWater2013-06-20 12:42:06
Qt
DancingOnWater, 2013-06-20 12:42:06

Build problems?

Apparently, the parser got confused somewhere, but the question is - how?
So, the crux of the problem. There is a project written in Qt 5.0.2 built on linux using gcc 4.6.3. But it is needed more on Windows. And here, for the first time in practice, serious problems began.
When trying to compile on Qt5.1.0RC1 + mingw 4.8 Crashes with the following error:
Hidden text

In file included from c:\qt\qt5.1.0rc1\tools\mingw48_32\i686-w64-mingw32\include\oleidl.h:7:0,
from c:\qt\qt5.1.0rc1\tools\mingw48_32\i686 -w64-mingw32\include\ole2.h:38,
from c:\qt\qt5.1.0rc1\tools\mingw48_32\i686-w64-mingw32\include\wtypes.h:12,
from c:\qt\qt5. 1.0rc1\tools\mingw48_32\i686-w64-mingw32\include\winscard.h:10,
from c:\qt\qt5.1.0rc1\tools\mingw48_32\i686-w64-mingw32\include\windows.h:97,
from ..\..\..\..\Qt\Qt5.1.0RC1\5.1.0-rc1\mingw48_32\include/QtCore/qt_windows.h:71,
from ..\..\..\.. \Qt\Qt5.1.0RC1\5.1.0-rc1\mingw48_32\include/QtCore/qwineventnotifier.h:48,
from ..\..\..\..\Qt\Qt5.1.0RC1\5.1.0- rc1\mingw48_32\include/QtCore/QtCore:79,
from ..\..\..\..\Qt\Qt5.1.0RC1\5.1.0-rc1\mingw48_32\include/QtConcurrent/QtConcurrentDepends:2,
from ..\..\..\..\Qt \Qt5.1.0RC1\5.1.0-rc1\mingw48_32\include/QtConcurrent/QtConcurrent:3,
from ..\UniversalViewer\main.cpp:2:
..\UniversalViewer\CameraSelectModel.h:34:73: error: expected ',' or '...' before 'struct'
void cameraData(const QModelIndex &index, ACameraDriversInterface **interface, QString *cameraName);
^
..\UniversalViewer\CameraSelectModel.h:41:34: error: expected unqualified-id before 'struct'
ACameraDriversInterface* interface;
^
In file included from ..\UniversalViewer\UniversalViewerCore.h:12:0,
from ..\UniversalViewer\main.cpp:5:
..\UniversalViewer\CameraSelectModel.h:41:32: error: expected ';' at end of member declaration
ACameraDriversInterface* interface;
^
..\UniversalViewer\CameraSelectModel.h:41:43: error: expected identifier before ';' token
ACameraDriversInterface* interface;

I tried to compile using Qt5.0.2 + mingw 4.7 The error came out similar
In file included from ..\UniversalViewer\UniversalViewerCore.h:12:0,
from ..\UniversalViewer\main.cpp:5:
..\UniversalViewer\CameraSelectModel.h:35:73: error: expected ',' or '...' before 'struct'
..\UniversalViewer\CameraSelectModel.h:42:34: error: expected unqualified-id before 'struct'
..\UniversalViewer\CameraSelectModel.h:42:32: error: expected ';' at end of member declaration
..\UniversalViewer\CameraSelectModel.h:42:43: error: expected identifier before ';' token

I began to dig and found out that, among other things, this situation was provided to me by the inclusion of the QtCore and QtConcurrent headers . The problem is generally solved, but I would like to know what is the reason. Maybe someone has some ideas?
UPD :
At the request, I post the code of the file itself and everything related:
Hidden text
#ifndef CAMERASELECTMODEL_H
#define CAMERASELECTMODEL_H


#include <QAbstractItemModel>

#include "ModulesManager.h"
#include "AFitsCameraDriver.h"
#include "GuiDescriptionCamera.h"

#include <QList>


/*!
 * \brief Модель данных о доступных камерах в системе.
 */

class CameraSelectModel : public QAbstractItemModel
{
    Q_OBJECT
public:
    CameraSelectModel(QObject *parent=0);
    void clear();
    QModelIndex index(int row, int column, const QModelIndex &parent) const;
    QModelIndex parent(const QModelIndex &child) const;
    int rowCount(const QModelIndex &parent = QModelIndex()) const;
    int columnCount(const QModelIndex &parent = QModelIndex()) const;
    virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
    virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;

    void identefyCamera(const QModelIndex & index, int* cameraTypeId, QString *cameraName);
    void updateCameraList();
    void updateCameraList(const QModelIndex & index);
    bool inline isCameraName(const QModelIndex & index ){return index.parent().isValid();}
    void cameraData(const QModelIndex &index, ACameraDriversInterface **interface, QString *cameraName);
private:
    struct Data
    {
        QString NameType;
        QList<QString> devicesName;
        bool isSystem;
        ACameraDriversInterface* interface;
    };
    QVector <Data> m_registedCamera;
    
    ModulesManager m_driverManger;
    AFitsCameraDriver m_hddCamera;
};

#endif // CAMERASELECTMODEL_H

#ifndef MODULESMANAGER_H
#define MODULESMANAGER_H

#include <QList>
#include <QPluginLoader>
class ModulesManager
{
public:
    ModulesManager();
    ~ModulesManager();
    void reReadModules();
    void loadDrivers(const QString &path);
    QString driversPath();
private:
    void clearModules();
public:
    QList<QPluginLoader*> m_modules;
private:
    QString m_path;
};

#endif // MODULESMANAGER_H

#ifndef AFITSCAMERADRIVER_H
#define AFITSCAMERADRIVER_H
#include <ACameraDriversInterface.h>
class AFitsCameraDriver: public QObject, public ACameraDriversInterface
{
    Q_OBJECT
    Q_INTERFACES(ACameraDriversInterface)
public:
    AFitsCameraDriver();
    //AAbstractCamera * createCamera()const;
    QString type() const;
    QString info() const;
    QString version() const;

};

#endif // AFITSCAMERADRIVER_H

#ifndef GUIDESCRIPTIONCAMERA_H
#define GUIDESCRIPTIONCAMERA_H
#include <qglobal.h>
#include <QMetaType>
struct GuiDescriptionCmaera
{
    template <typename T> struct Range{
        T min;
        T max;
    };
    Range<unsigned long> exposeRange;
    Range<unsigned long> frequencyRange;
    Range<unsigned long> gainRange;
    Range<qint32> tempretureRange;

    bool canSetExpose;
    bool canSetFrequency;
    bool canSetGain;
    bool canSetTrigMode;
    bool canSetTragetTempreture;
    bool canSetBining;

};

Q_DECLARE_METATYPE(GuiDescriptionCmaera)

#endif // GUIDESCRIPTIONCAMERA_H

#pragma once

//#include <AAbstractCamera.h>
#include <QMetaType>
#ifndef A_CAMERA_DRIVERS_INTERFACE_IID
#define A_CAMERA_DRIVERS_INTERFACE_IID "camerainterface.drivers.alpha"
#endif

struct ACameraDescription
{
    bool canSetExpose;
    bool canSetFrequency;
    bool canSetGain;
    bool canSetTrigMode;
    bool canSetTragetTempreture;
    bool canSetBining;
};

class ACameraDriversInterface
{
public:
    ACameraDriversInterface() {}
    virtual ~ACameraDriversInterface(){}
    const ACameraDescription & description()const {return m_description;}
 //   virtual AAbstractCamera * createCamera()const =0;
    virtual QString type() const =0;
    virtual QString info() const=0;
    virtual QString version() const =0;
protected:
    ACameraDescription m_description;
};

Q_DECLARE_INTERFACE(ACameraDriversInterface, A_CAMERA_DRIVERS_INTERFACE_IID)
Q_DECLARE_METATYPE(ACameraDescription)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Door, 2013-06-20
@DancingOnWater

maybe it has to do with the reserved word interface, which is ObjBase.hdefined as

#define __STRUCT__ struct
#define interface __STRUCT__

It seems to me that they missed it somewhere, did not turn it on<Windows.h>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question